An implementation of Zend Framework 1
PHP JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
application
data
lib
public
.gitattributes
.gitignore
README.md
_.htaccess

README.md

Zend Flexible

Zend Flexible is a ready-to-use Zend Framework 1 based sub-framework with flexible directoy structure. Instead of the standard MVC Model 2 Controller / Action structure, it uses directories instead of classes and seperate files instead of methods.

This way, you can use unlimited number of sub-directories to organize your code and have less code per file. So instead of:

/application/controllers/some.php:
SomeController {
  indexAction
  firstAction
  secondAction
}

you'll have:

/application/controllers/some/some.php
SomeController {
  run
}
/application/controllers/some/first.php
SomeFirstController {
  run
}
/application/controllers/some/second.php
SomeSecondController {
  run
}

It's 99% Zend Framework compatible, only extends the dispatcher etc. so the rest should be the same with ZF1.

Proxy Functions

Proxy functions are the shortcuts to the Zend Framework methods which allows you to type less and do more. Here's the list:

__($msg, $params)   Translation
h($string)          Simple html entities
debug($var)         Shortcut to Zend_Debug::dump(), displays nothing in production mode so if you forget it, 
                    you'll still be safe...
nvl($param, $val)   Inspired by Oracle SQL. Means: null value. So if $param is empty $val is displayed.

Utility Methods

Some handy utility functions are added

Zf_Util_Upload::getMaxUploadSize
Zf_Util_Upload::readUploadedImage

Zf_Util_String::dsprintf
Zf_Util_String::parseUri
Zf_Util_String::closeHtmlTags
Zf_Util_String::shortenHtml
Zf_Util_String::checkPasswordStrength

Zf_Util_Inflect::pluralize
Zf_Util_Inflect::singularize

Zf_Util_File::formatBytes
Zf_Util_File::createGdImage
Zf_Util_File::recursiveRemoveDirectory

Zend Framework Extensions

Zf_Application

"cli" mode is added. So you can run your project from shell like: php public/index.php --uri=/your/route Added an exception handler

Zf_Model

A very simple class for very small projects. Just extend your model file from this class and run your sqls directly.

Zf_Model_TableGateway extends Zend_Db_Table_Abstract

Automatically detect table names. Table names are assumed to be plural. Added "findRow" method. Added "create" method

Zf_Config

Easier config file loading with Zf_Config::load($file)

Zf_Controller extends Zend_Controller_Action

Added some proexy methods to let IDEs to complete helper methods. Example:

  $this->disableLayout() calls: $this->_helper->_layout->disableLayout()

Also added redirectTo method which returns to previous page automatically.

Zf_Mail extends Zend_Mail

Easier html messages. Put your html e-mail message template files under /application/views/mail_templates and run:

  Zf_Mail::factory($user->email, 'Your account created successfuly')
      ->setViewFile('confirmed_registration.phtml', array('nick' => $user->nick, 'password' => $user->passwd))
      ->send()

Layout is supported too. See: /application/views/layouts/mail.phtml

Controller Plugins

Following plugins are added:

AutoRedirection

Saves the current url to session so that you can redirect to previous page within your controllers with $this->redirectTo(null, 'Your flash message');

IpRestriction

Restrict IPs from config file

Maintenance

Enable maintenance mode from config file

Configuration

yaml formatted config file are used by default