This is an application skeleton for Phalcon3 Framework. This application is meant to be used as a starting place. It's built on top of https://github.com/mamuz/phalcon-application which simplifies application bootstrapping.
PHP7 and Phalcon3 is needed, follow install steps at https://github.com/phalcon/cphalcon
composer create-project -n -sdev mamuz/phalcon-skeleton path/to/install
Run ./bin/customize.sh
inside application root to customize the project.
It will ask you for assigning following changes:
-
Enter the new classnamespace identifier to use
Composer Autoloader is mapping as
"autoload": {"psr-4": {"PhalconSkeleton\\": "src/"}}
e.g customizing the identifier to
Application
will lead to"autoload": {"psr-4": {"Application\\": "src/"}}
, according to that all FQCN of all classes will be changed. -
Enter composer namespace
Composer project name is defined as
"name": "mamuz/phalcon-skeleton"
e.g. customizing the namespace to
user/application
leads to"name": "user/application"
-
Enter a short project description
This text is used for prepared README.md and will be placed as
description
value insidecomposer.json
-
Enable view support?
If support is desired, application config will be prepared and in addition you will have example view templates.
Please check https://github.com/mamuz/phalcon-application for detailed informations about bootstrapping. For Phalcon usages in general please visit https://docs.phalconphp.com.
This application uses Monolog
as a logger, you can customize it in
https://github.com/mamuz/phalcon-skeleton/blob/master/config/application.php
Error Handling with Phalcon's MVC is implemented in https://github.com/mamuz/phalcon-skeleton/blob/master/src/Application/Service/ErrorHandler.php
First of all create a Factory inside src/Application/Service
, register that factory to services in
application config
.
After that you should add a Getter
for that to
Service Aware Trait
,
which make your life easier for fetching those ones inside your controllers.