Mvc\Application::useImplicitView

public useImplicitView (mixed $implicitView) By default. The view is implicitly buffering all the output You can full disable the view component using this method

Mvc\Application::handle

public handle ([mixed $uri]) Handles a MVC request

Mvc\Application

extends abstract class Phalcon\Application implements Phalcon\Di\InjectionAwareInterface, Phalcon\Events\EventsAwareInterface Source on GitHub This component encapsulates all the complex operations behind instantiating every component needed and integrating it with the rest to allow the MVC pattern to operate as desired. use Phalcon\Mvc\Application; class MyApp extends Application { /** * Register the services here to make them general or register * in the ModuleDefinition to

MVC Applications

All the hard work behind orchestrating the operation of MVC in Phalcon is normally done by Phalcon\Mvc\Application. This component encapsulates all the complex operations required in the background, instantiating every component needed and integrating it with the project, to allow the MVC pattern to operate as desired. Single or Multi Module Applications With this component you can run various types of MVC structures: Single Module Single MVC applications consist of one module only. Namespaces

Multi-lingual Support

The component Phalcon\Translate aids in creating multilingual applications. Applications using this component, display content in different languages, based on the user’s chosen language supported by the application. Adapters This component makes use of adapters to read translation messages from different sources in a unified way. Adapter Description Phalcon\Translate\Adapter\NativeArray Uses PHP arrays to store the messages. This is the best option in terms of performance. Component Usage Tr

Models Metadata

To speed up development Phalcon\Mvc\Model helps you to query fields and constraints from tables related to models. To achieve this, Phalcon\Mvc\Model\MetaData is available to manage and cache table metadata. Sometimes it is necessary to get those attributes when working with models. You can get a metadata instance as follows: $robot = new Robots(); // Get Phalcon\Mvc\Model\Metadata instance $metadata = $robot->getModelsMetaData(); // Get robots fields names $attributes = $metadata->getA

Model Transactions

When a process performs multiple database operations, it might be important that each step is completed successfully so that data integrity can be maintained. Transactions offer the ability to ensure that all database operations have been executed successfully before the data is committed to the database. Transactions in Phalcon allow you to commit all operations if they were executed successfully or rollback all operations if something went wrong. Manual Transactions If an application only use

Model Relationships

Relationships between Models There are four types of relationships: one-on-one, one-to-many, many-to-one and many-to-many. The relationship may be unidirectional or bidirectional, and each can be simple (a one to one model) or more complex (a combination of models). The model manager manages foreign key constraints for these relationships, the definition of these helps referential integrity as well as easy and fast access of related records to a model. Through the implementation of relations, i

Model Events

Events and Events Manager Models allow you to implement events that will be thrown while performing an insert/update/delete which can be used to define business rules. The following are the events supported by Phalcon\Mvc\Model and their order of execution: Operation Name Can stop operation? Explanation Inserting/Updating beforeValidation YES Is executed before the fields are validated for not nulls/empty strings or foreign keys Inserting beforeValidationOnCreate YES Is executed before the fiel

Model Behaviors

Behaviors are shared conducts that several models may adopt in order to re-use code, the ORM provides an API to implement behaviors in your models. Also, you can use the events and callbacks as seen before as an alternative to implement Behaviors with more freedom. A behavior must be added in the model initializer, a model can have zero or more behaviors: use Phalcon\Mvc\Model; use Phalcon\Mvc\Model\Behavior\Timestampable; class Users extends Model { public $id; public $name; pub