Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2017-08-19 (2 months ago) ![RSS 2.0 feed](/graphics/phpclasses/rss2.png) | | Not yet rated by the users | | Total: 2 This week: 2 | | All time: 9,072 This week: 346![Up](/graphics/phpclasses/up.png) |
|
Description | | Author |
This package is a MVC framework with controllers using annotations.
It provides base controller classes that need to be extended by applications to handler application requests.
The package extracts annotations from the actual application controller classes to determine how requests should be routed. | |
![Picture of Maik Greubel Picture of Maik Greubel](/picture/user/1269507.png) |
|
Innovation award
![Innovation award](/graphics/phpclasses/innovation-award-logo.png) Nominee: 4x |
|
Details
![Dependency Status](https://www.versioneye.com/user/projects/56392b3ac30cb5000b000554/badge.svg?style=flat)
caribu-mvc
Tiny annotation based MVC framework
For now only a simple example, what you can do with Caribu MVC.
composer.json:
{
"require" : {
"nkey/caribu-mvc" : "dev-master",
"nkey/phpgenerics" : "dev-master",
"psr/log" : "1.0.0"
}
}
public/index.php:
<?php
require dirname(__FILE__) . '/../vendor/autoload.php';
use \Nkey\Caribu\Mvc\Controller\AbstractController;
use \Nkey\Caribu\Mvc\Controller\Request;
use \Nkey\Caribu\Mvc\Application;
use \Nkey\Caribu\Mvc\View\AbstractView;
use \Generics\Logger\ExtendedLogger;
/
* A simple test controller
*
* @author Maik Greubel <greubel@nkey.de>
*
* This file is part of Caribu MVC package
*/
class IndexController extends AbstractController
{
/
* @webMethod
*
* @title Hey there page
*/
public function index()
{
echo "Hey, there!\n\n";
}
/
* @responseType text/plain
*
* @param \Nkey\Caribu\Mvc\Controller\Request $request
*/
public function paramTest(Request $request)
{
foreach ($request->getParams() as $param => $value) {
printf("%s => %s\n", $param, $value);
}
}
}
// Preparing
Application::getInstance()->registerController('IndexController')
->setLogger(new ExtendedLogger());
// Serving
Application::getInstance()->serve();
Then in your browser window open http://host/ and see the output of index() web method.
The address http://host/index, as well as http://host/index/index provides the same functionality.
Surf to http://host/index/paramTest/param1/Hello/param2/Caribu or to get the same output
the address http://host/index/paramTest?param1=Hello¶m2=Caribu
Documentation follows soon in wiki.
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.