Quasar Framework is open-source, dependency injection based web application MVC framework. It's implemented in PHP 5.3.
Quasar Framework is inspired by both Zend Framework and Konstrukt
The dependency injection container (Quasar\Di) is based on a project, known as Phemto. Nevertheless Phemto was refactored, many bugs were fixed and many new features were added.
Setting up Quasar is trivial easy, just clone the repository into your server root directory
$ cd /home/user/path/to/server/root
$ git clone git://github.com/sasquatch-mc/quasar-framework.git
or download the tarball/zip package and extract it.
Using Quasar is very easy.
After you get Quasar, you can test it by navigating your browser to the public_html/ directory(e.g. http://localhost/quasar-framework/public_html). A welcome page with the Quasar Framework logo should appear.
In the examples below we will use a virtual host (http://quasar.localhost) which will point to public_html
Unlike Zend Framework, controllers here are not action controllers (with dispatchable methods). Here we use only one method (execute()) to invoke controller's functionality. The default (index) controller in Quasar is named 'Root' and It's placed in src/app/controllers/Root.php
Example:
src/app/controllers/My.php:
<?php
namespace app\controllers;
use quasar\controller\Controller;
class My extends Controller
{
public function execute()
{
$this->response->message = 'Hello world!';
}
}
We need a view script for this controller:
src/app/views/templates/my.phtml:
<h2>This is my first controller!</h2>
<hr />
<?=$this->message?>
And we are done! You can acces this controller by refering to http://quasar.localhost/my
Quasar implements something that I call nested controllers. This means that one controller can forward to another. For example if I create a controller named 'Settings', and place it in src\app\controllers**\my\Settings.php** I'll be able to access it by refering to http://quasar.localhost/my/settings. In order to make the 'Settings' controller available, 'My' controller also has to exist.
What Quasar does is that when the request is created the requested controllers are chained and invoked one after another. You can nest how many controllers as you want to whatever depth you want.