Awesome
A base application for Yaf framework
Yaf framework documentation can be found at php.net
Requirements
- Yaf php extension. Download and install from Pecl
- PHP 5.3+
- Mysql server
- Apache, Nginx or Lighttpd web server.
- mod_rewrite and .htaccess enabled for Apache web server.
Configuration
- Info about setting up a server for Yaf can be found here
- Rename
config/application.ini.default
toconfig/application.ini
- If you have PHP 5.4 you can use the internal web server to test the project.
cd yaf_base_application/public
php -S localhost:8000
- This project uses PHP 5.3 namespaces so
yaf.use_namespace
should be turned on.
Additions
A simple ORM database layerlib/Orm
. Yaf Models extendlib/Orm/Entity
class. (More documentation soon at wiki)- Validation library
lib/Validations
from another project of mine for validating classes. - A Layout class that allows to render views inside a base html layout
lib/Layout.php
. Layouts directory can be defined in application.ini - A Logger class
lib/Logger.php
and aLoggerPlugin
to log info about requests and database queries. (Make sure that log directory is readable.) - A custom Request class
lib/Request.php
that extendsYaf\Request\Http
and offers input filter for request params, posts and queries. A Paginatorlib/Paginator
forked from Laravel framework and adjust it to work withlib/Orm
- An Authenticity token plugin
AuthTokenPlugin
to prevent Cross-site request forgery (csrf). Can be turned on/off from application.ini - A base
ApplicationController
which adds some base functionality like 404 not found page. - A
RestfullController
to make easy crud (create, read, update, delete) actions. - An
ErrorController
to catch all exceptions and display a page with error info and bugtrace. - Custom error_handler to catch errors and throws Exceptions.
- Custom _init.php file for modules for extra configuration.
- Some base helper classes
lib/Helper