mamuz / phalcon-skeleton
Simple skeleton application using the Phalcon3 Framework
Installs: 290
Dependents: 0
Suggesters: 0
Security: 0
Stars: 14
Watchers: 5
Forks: 5
Open Issues: 0
Type:project
Requires
- mamuz/phalcon-application: ~2.2
- monolog/monolog: ~1.21
README
Introduction
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.
Requirements
PHP7 and Phalcon3 is needed, follow install steps at https://github.com/phalcon/cphalcon
Install
Step 1: Create new project with composer
composer create-project -n -sdev mamuz/phalcon-skeleton path/to/install
Step 2: Customize new project to your needs
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.
How To's
Please check https://github.com/mamuz/phalcon-application for detailed informations about bootstrapping. For Phalcon usages in general please visit https://docs.phalconphp.com.
Logging
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
Error Handling with Phalcon's MVC is implemented in https://github.com/mamuz/phalcon-skeleton/blob/master/src/Application/Service/ErrorHandler.php
Adding new Services
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.