php annotation mvc
Install the latest version with
$ composer require smiler/autumn
<?php
/**
* @controller
* @path ("/hw")
*/
class HelloWorld
{
/**
* @autowired ({"name":"hello_world"})
*/
private $helloWorldModel;
/**
* @route({"method":["GET","POST"],"path":"/"})
*/
public function doSomething1()
{
$this->helloWorldModel->execute();
}
}
<?php
/**
* @model (hello_world)
*/
class HelloWorldModel
{
/**
* @database ({"name":"source_name"})
*/
private $db;
public function execute()
{
echo 345677;
}
}
the name of php file must be equals to the class name,eg.
HelloWorld.php
class HelloWorld{}
- PHP > 5.4
spiderman - [email protected]
Autumn is licensed under the MIT License - see the LICENSE
file for details
PHP Reflection
JsonPath
Class Annotation