我使用phpdocumentor为我的项目生成文档。它可以为我的函数生成良好的文档,例如:
/**
* Hash generator
*
* Long description
*
* @param string $password Password
* @return string
*/
function generate_hash($password) {
global $PASSWORD_SALT;
return crypt($password, $PASSWORD_SALT);
}
但是我还没有找到一种为slim (php框架)文档化映射的方法:
/**
* Delete news
*
* Delete news by id
*
* @link /news/delete/:id
*
*/
$app->get('/news/delete/:id', function ($id) use ($app) {
$item = ORM::for_table('news')->find_one($id);
if ($item)
$item->delete();
$app->redirect('/');
})->conditions(array('id'=>'\d+'));
如何正确地记录类似这样的事情?