本文整理汇总了PHP中Requests::json_success方法的典型用法代码示例。如果您正苦于以下问题:PHP Requests::json_success方法的具体用法?PHP Requests::json_success怎么用?PHP Requests::json_success使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Requests
的用法示例。
在下文中一共展示了Requests::json_success方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ucfirst
$action = ucfirst(strtolower($action));
$controller_name = "{$action}Controller";
return View::make("{$category}/{$controller_name}");
})->where('category', '.*')->where('action', '.*');
Route::any('/1.0/{category}/{object}/{action}', function ($category, $object, $action) {
$category = strtolower($category);
$object = ucfirst(strtolower($object));
$action = ucfirst(strtolower($action));
$controller_name = "{$object}{$action}Controller";
require_once __DIR__ . "/controllers/{$category}/{$controller_name}.php";
$controller = new $controller_name();
$result = $controller->run();
if (is_array($result) || is_object($result)) {
Requests::json_success($result);
} else {
Requests::json_error($result);
}
})->where('category', '.*')->where('object', '.*')->where('action', '.*');
Route::any('/1.0/{category}/{action}', function ($category, $action) {
$category = strtolower($category);
$action = ucfirst(strtolower($action));
$controller_name = "{$action}Controller";
require_once __DIR__ . "/controllers/{$category}/{$controller_name}.php";
$controller = new $controller_name();
$result = $controller->run();
if (is_array($result) || is_object($result)) {
Requests::json_success($result);
} else {
Requests::json_error($result);
}
})->where('category', '.*')->where('action', '.*');