Download the PHP package mamuz/phalcon-application without Composer
On this page you can find all versions of the php package mamuz/phalcon-application. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mamuz/phalcon-application
More information about mamuz/phalcon-application
Files in mamuz/phalcon-application
Package phalcon-application
Short Description Phalcon Application provides simple and customizable application bootstrapping
License MIT
Homepage https://github.com/mamuz/phalcon-application
Informations about the package phalcon-application
phalcon-application
Phalcon Application is built on top of Phalcon3 Framework and provides simple and customizable application bootstrapping.
Requirements
- Phalcon3 is needed, follow install steps at https://github.com/phalcon/cphalcon
Installation
Install the latest version with
Features
- Autoloading with Composer
- Simple mvc configuration
- Service registration
- XHR friendly view renderer
Usage
Bootstrapping an application without view support, e.g. a REST application
For more details have a look to the functional tests at https://github.com/mamuz/phalcon-application/blob/master/tests/functional/ActionDomainResponseCest.php based on that example project.
Bootstrapping an application with view support (mostly to response with rendered HTML)
Check https://docs.phalconphp.com/en/latest/reference/views.html for using views in Phalcon.
Phalcon's view engine supports the three-step view template pattern. That means you can have a main-layout (outerframe), which includes a controller based layout (frame), which in turn includes an action based layout (innerframe).
Like this:
So each controller action can have an own template for rendering.
For instance you have a controller with two actions like:
User::loginAction
User::logoutAction
This leads to two view templates located at:
{viewbasepath}\user\login.phtml
{viewbasepath}\user\logout.phtml
Regarding the three-step view template pattern you can place these ones at:
{viewbasepath}\index.phtml
(outerframe must be named as index and needs to be placed at the root level){viewbasepath}\layouts\user.phtml
(frame must be named like the controller and needs to be placed inside layouts folder)
In case of ajax requests (XHR) outerframe and frame rendering is disabled, which means only the innerframe is rendered.
For more details have a look to the functional tests at https://github.com/mamuz/phalcon-application/blob/master/tests/functional/ViewCest.php based on that example project.
Bootstrapping an application as a command line tool
Check https://docs.phalconphp.com/en/latest/reference/cli.html#tasks for creating tasks.
Run a command with arguments
Let's imagine that the application is bootstrapped inside index.php
That will call the send
action from the mailing
task with invoking reminder
as an argument.
Run a command with arguments and options
Let's imagine that the application is bootstrapped inside index.php
That will call the send
action from the mailing
task with invoking reminder
as an argument.
Inside the send
action the options are aware by $this->dispatcher->getOptions()
.
For more details have a look to the functional tests at https://github.com/mamuz/phalcon-application/blob/master/tests/functional/CommandLineCest.php based on that example project.
Application Skeleton
To have a good starting place you should check the skeleton which is based on this project.
All versions of phalcon-application with dependencies
ext-phalcon Version ^3.3