Skip to content
An example of a base application for Yaf framework
Branch: master
Clone or download
Latest commit 225608d Mar 29, 2013
Type Name Latest commit message Commit time
Failed to load latest commit information.
app fix error_handler Mar 29, 2013
config Merge branch 'master' of Feb 13, 2013
lib set main content to var Nov 20, 2012
log Initial commit Jul 5, 2012
public minor changes Nov 20, 2012
vendor add vendor folder Nov 20, 2012
.gitignore Initial commit Jul 5, 2012 update readme Feb 13, 2013

A base application for Yaf framework

Yaf framework documentation can be found at


  • 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.


  • Info about setting up a server for Yaf can be found here
  • Rename config/application.ini.default to config/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.


  • A simple ORM database layer lib/Orm. Yaf Models extend lib/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 a LoggerPlugin to log info about requests and database queries. (Make sure that log directory is readable.)
  • A custom Request class lib/Request.php that extends Yaf\Request\Http and offers input filter for request params, posts and queries.
  • A Paginator lib/Paginator forked from Laravel framework and adjust it to work with lib/Orm
  • An Authenticity token plugin AuthTokenPluginto 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
You can’t perform that action at this time.