Download .zip |
Info | Example | View files (45) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2017-08-19 (2 months ago) | Not yet rated by the users | Total: 2 This week: 2 | All time: 9,072 This week: 346 |
Version | License | PHP version | Categories | |||
caribu-mvc 1.0 | GNU General Publi... | 7 | Design Patterns, PHP 7 |
Description | Author | |
This package is a MVC framework with controllers using annotations. |
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.
Files |
File | Role | Description | ||
---|---|---|---|---|
contrib (2 files) | ||||
src (1 directory) | ||||
tests (3 files, 2 directories) | ||||
.travis.yml | Data | Auxiliary data | ||
build.xml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
phpcs.xml | Data | Auxiliary data | ||
phpdox.xml | Data | Auxiliary data | ||
phpmd.xml | Data | Auxiliary data | ||
phpunit.xml | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
Files | / | src | / | Mvc |
File | Role | Description | ||
---|---|---|---|---|
Controller (5 files) | ||||
Router (2 files) | ||||
Util (2 files) | ||||
View (5 files, 1 directory) | ||||
Application.php | Class | Class source |
Files | / | src | / | Mvc | / | Controller |
File | Role | Description |
---|---|---|
AbstractController.php | Class | Class source |
ControllerException.php | Class | Class source |
ErrorController.php | Class | Class source |
Request.php | Class | Class source |
Response.php | Class | Class source |
Files | / | src | / | Mvc | / | Router |
File | Role | Description |
---|---|---|
AbstractRouter.php | Class | Class source |
RouterException.php | Class | Class source |
Files | / | src | / | Mvc | / | Util |
File | Role | Description |
---|---|---|
RequestParser.php | Class | Class source |
Session.php | Class | Class source |
Files | / | src | / | Mvc | / | View |
File | Role | Description | ||
---|---|---|---|---|
Controls (3 files) | ||||
AbstractView.php | Class | Class source | ||
Control.php | Class | Class source | ||
DefaultView.php | Class | Class source | ||
View.php | Class | Class source | ||
ViewException.php | Class | Class source |
Files | / | src | / | Mvc | / | View | / | Controls |
File | Role | Description |
---|---|---|
ControlException.php | Class | Class source |
Form.php | Class | Class source |
Image.php | Class | Class source |
Files | / | tests |
File | Role | Description | ||
---|---|---|---|---|
feature-test (9 files) | ||||
router-test (4 files) | ||||
.htaccess | Data | Auxiliary data | ||
index.php | Example | Example script | ||
SimpleController.php | Example | Class source |
Files | / | tests | / | feature-test |
File | Role | Description |
---|---|---|
ControlsController.php | Class | Class source |
ControlsTest.php | Class | Class source |
DoNothingView.php | Class | Class source |
FeatureTest.php | Class | Class source |
FeatureTestController.php | Class | Class source |
InvalidController.php | Class | Class source |
InvalidView.php | Class | Class source |
RequestTest.php | Class | Class source |
ViewTest.php | Class | Class source |
Files | / | tests | / | router-test |
File | Role | Description |
---|---|---|
RoutedController.php | Class | Class source |
RoutingTest.php | Class | Class source |
RoutingTestController.php | Class | Class source |
TestRouter.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.