}); //分类链接 Macaw::get('/category/(:num).html', function ($slug) { $home = new HomeController(); $home->category($slug); }); //ajax刷新 Macaw::get('/home/getdata/', function () { $home = new HomeController(); $home->getAjaxData(); }); //文章链接 Macaw::get('/article/(:num).html', function ($slug) { $home = new HomeController(); $home->artice($slug); }); //登录 Macaw::get('/admin/login/', 'LoginController@login'); Macaw::post('/admin/login/', 'LoginController@login'); //验证码 Macaw::get('/admin/code', 'LoginController@code'); //退出登录 Macaw::get('/admin/logout/', 'LoginController@logout'); Macaw::$error_callback = function () { throw new Exception("路由无匹配项 404 Not Found"); }; Macaw::get('/admin/test/page/(:num)/key/(:any)', function ($num, $param) { $mytestController = new MytestController(); $mytestController->home($num, $param); }); Macaw::dispatch();
<?php use NoahBuscher\Macaw\Macaw; Macaw::get('/user/name', 'HomeController@home'); Macaw::get('/f**k', function () { $value = 'HeadFirstComponet'; $replace = '$1' . '_' . '$2'; echo strtolower(preg_replace('/(.)([A-Z])/', $replace, $value)); }); Macaw::get('/f**k', function () { echo '又成功了'; }); // Macaw::get('(:all)', function($fu){ // echo '未匹配到路由<br/>'.$fu; // }); Macaw::$error_callback = function () { throw new Exception("路由无匹配项 404 Not Found"); }; //new add //new line dev //bubu //hehe Macaw::dispatch();
<?php use NoahBuscher\Macaw\Macaw; Macaw::get('/index', function () { echo "成功!"; }); Macaw::get('/hello', 'HomeController@home'); Macaw::get('/mail', 'HomeController@mail'); Macaw::get('/redis', 'HomeController@redistest'); // Macaw::get('(:all)', function($fu) { // echo '未匹配到路由<br>'.$fu; // }); // Macaw::error(function() { // echo '404 :: Not Found'; // }); Macaw::$error_callback = function () { throw new Exception("路由无匹配项 404 Not Found"); }; Macaw::dispatch();
<?php use NoahBuscher\Macaw\Macaw; Macaw::get('/', 'HomeController@home'); Macaw::get('/f**k', function () { echo 'f**k'; }); Macaw::get('/(:all)', function () { echo '没有对应的路由'; }); Macaw::dispatch();
<?php /** * Created by PhpStorm. * User: meathill * Date: 14/11/12 * Time: 下午5:24 */ use NoahBuscher\Macaw\Macaw; Macaw::get(BASE . '', 'diy\\controller\\HomeController@home'); Macaw::get(BASE . 'dashboard/', 'diy\\controller\\HomeController@dashboard'); Macaw::options(BASE . 'file/', 'diy\\controller\\BaseController@on_options'); Macaw::post(BASE . 'file/', 'diy\\controller\\FileController@upload'); Macaw::options(BASE . 'fetch/', 'diy\\controller\\BaseController@on_options'); Macaw::post(BASE . 'fetch/', 'diy\\controller\\FileController@fetch'); Macaw::error(function () { echo '404 :: Not Found'; });
<?php use NoahBuscher\Macaw\Macaw; Macaw::get('test', function () { echo "<pre>"; print_r($_SERVER); }); Macaw::get('/home', 'HomeController@home'); /*Macaw::get('(:all)',function($fu){ echo '未匹配到路由<br/>'.$fu; });*/ Macaw::$error_callback = function () { throw new Exception("404 Not Found"); }; Macaw::dispatch();
<?php /** * Created by PhpStorm. * User: meathill * Date: 15/5/19 * Time: 上午10:58 */ use NoahBuscher\Macaw\Macaw; Macaw::options(BASE . 'agreement/(:any)', 'diy\\controller\\BaseController@on_options'); Macaw::patch(BASE . 'agreement/(:any)', 'diy\\controller\\AgreementController@renew'); Macaw::get(BASE . 'agreement/', 'diy\\controller\\AgreementController@get_list');
<?php /** * Created by PhpStorm. * User: meathill * Date: 14/11/15 * Time: 下午6:02 */ use NoahBuscher\Macaw\Macaw; Macaw::get(BASE . 'ad/', 'diy\\controller\\ADController@get_list'); Macaw::get(BASE . 'ad/(:any)', 'diy\\controller\\ADController@init'); Macaw::get(BASE . 'ad_basic/', 'diy\\controller\\ADController@get_list_basic'); Macaw::options(BASE . 'ad/(:any)', 'diy\\controller\\BaseController@on_options'); Macaw::post(BASE . 'ad/(:any)', 'diy\\controller\\ADController@create'); Macaw::patch(BASE . 'ad/(:any)', 'diy\\controller\\ADController@update'); Macaw::delete(BASE . 'ad/(:any)', 'diy\\controller\\ADController@delete'); Macaw::get(BASE . 'ad/(:any)/upload/', 'diy\\controller\\ADController@get_upload_history'); Macaw::get(BASE . 'apply/', 'diy\\controller\\ApplyController@get_list'); Macaw::options(BASE . 'apply/(:any)', 'diy\\controller\\BaseController@on_options'); Macaw::patch(BASE . 'apply/(:any)', 'diy\\controller\\ApplyController@update'); Macaw::delete(BASE . 'apply/(:any)', 'diy\\controller\\ApplyController@delete'); Macaw::get(BASE . 'info/', 'diy\\controller\\HistoryInfo@get_list'); Macaw::post(BASE . 'baobei/(:any)', 'diy\\controller\\ADController@resend_baobei_email'); Macaw::get(BASE . 'data-load/(:any)', 'diy\\controller\\ADController@data_load'); Macaw::get(BASE . 'competitor_ad/', 'diy\\controller\\CompetitorAdController@get'); Macaw::options(BASE . 'competitor_ad/(:any)', 'diy\\controller\\BaseController@on_options'); Macaw::patch(BASE . 'competitor_ad/(:any)', 'diy\\controller\\CompetitorAdController@update');
/** * CFPHP - A utility and can faster php framework * * @author xiaobeicn <*****@*****.**> * * @description 路由规则 * */ use NoahBuscher\Macaw\Macaw as Route; Route::get('/', 'HomeController@hello'); /** * http://localhost/cfphp/home/demo/aaa/123/a-b-c * * public function demo($parameters){ * cf_dump($parameters); * } * * //string 'aaa,123,a-b-c' (length=13) * */ Route::get('/home/demo/(:any)/(:num)/(:all)', 'HomeController@demo'); Route::get('/home/model', 'HomeController@model'); Route::get('/home/redis', 'HomeController@redis'); Route::get('/home/upload', 'HomeController@upload'); Route::post('/home/upload', 'HomeController@upload'); Route::get('/home/mail', 'HomeController@mail'); Route::get('/home/image', 'HomeController@image'); Route::get('/home/log', 'HomeController@log'); Route::error(function () { echo '404 :: Not Found'; });
return ["err" => "ERROR_SAVE_TO_DATABASE"]; } } else { return ["err" => "VALIDATE_FORM_ERROR", "errors" => $gump->errors()]; } } // создание события Macaw::post('/create_event', function () { Log::toDebug("CREATE EVENT ROUTE"); $user = checkAuth(); Application::sendJson(processForm($_POST, $user)); }); // вспомогательные данные Macaw::get('source', function () { Log::toDebug("source"); $user = checkAuth(); Application::sendJson(["repair_post" => RepairPost::all(), "repair_type" => RepairType::all(), "state" => [["id" => 0, "name" => "Назначено"], ["id" => 1, "name" => "Выполнено"], ["id" => 2, "name" => "Отклонено"]]]); }); function PopulateEvent($event) { return ["user_owner_id" => User::retrieveByPK($event->user_owner_id), "user_target_id" => User::retrieveByPK($event->user_target_id), "customer_id" => Customer::retrieveByPK($event->customer_id), "customer_car_id" => CustomerCar::retrieveByPK($event->customer_car_id)]; } function buildQueryAndEqStatement($name, $value, $op = "=", $escape = false) { if ($escape) { return " AND {$name}{$op}'{$value}' "; } return " AND {$name}{$op}{$value} "; } // список событий Macaw::post('events', function () {
<?php /** * Created by PhpStorm. * User: meathill * Date: 15/5/19 * Time: 上午10:58 */ use NoahBuscher\Macaw\Macaw; Macaw::options(BASE . 'channel/', 'diy\\controller\\BaseController@on_options'); Macaw::post(BASE . 'channel/', 'diy\\controller\\ChannelController@create'); Macaw::get(BASE . 'channel/', 'diy\\controller\\ChannelController@get_list'); Macaw::options(BASE . 'channel/(:any)', 'diy\\controller\\BaseController@on_options'); Macaw::patch(BASE . 'channel/(:any)', 'diy\\controller\\ChannelController@update'); Macaw::delete(BASE . 'channel/(:any)', 'diy\\controller\\ChannelController@delete'); Macaw::options(BASE . 'crm/', 'diy\\controller\\BaseController@on_options'); Macaw::get(BASE . 'crm/', 'diy\\controller\\ChannelController@get_ads');
* @link http://www.axiong.me * @version $Id$ * @lastmodified: 2014-06-16 14:41 * */ use NoahBuscher\Macaw\Macaw as Route; use Nickfan\AppBox\Common\BoxConstants; use Nickfan\BoxApp\Support\Facades\BoxDispatcher; use Nickfan\BoxApp\Support\Facades\BoxView; Route::get('/favicon.ico', function () { $content = base64_decode(BoxConstants::TRANSGIFDATA); $contentType = 'image/gif'; header('Content-Type: ' . $contentType); header('Content-Length: ' . strlen($content)); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); echo $content; exit; }); Route::get('/', function () { return BoxView::make('hello')->render(); }); Route::get('/hello', function () { echo 'Welcome to AppBox' . '<br>' . PHP_EOL; echo BoxDispatcher::getHost() . '<br>' . PHP_EOL; echo BoxDispatcher::getDomain() . '<br>' . PHP_EOL; }); Route::get('/box', '\\App\\Boxcontrollers\\Localhost\\Index\\Index@Index'); Route::get('/ping', '\\App\\Boxcontrollers\\Localhost\\Index\\Index@Ping');
<?php use NoahBuscher\Macaw\Macaw; Macaw::get('/', function () { echo 'Hello world!'; }); Macaw::get('/home', 'HomeController@home'); Macaw::get('/test', 'HomeController@test'); /*Macaw::error(function () { echo '404 :: Not Found'; });*/ Macaw::$error_callback = function () { throw new Exception("路由无匹配项 404 Not Found"); }; Macaw::dispatch();
<?php use NoahBuscher\Macaw\Macaw; Macaw::get('f**k', function () { echo 'ok'; }); /* Macaw::get('(:all)', function($fu) { echo $fu; }); */ Macaw::get('home/user', '\\App\\Controllers\\HomeController@user'); Macaw::get('home/article', '\\App\\Controllers\\HomeController@article'); //404 Macaw::$error_callback = function () { throw new Exception('路由无匹配项 404 Not Found'); }; Macaw::dispatch();
<?php /** * Routes 路由规则 * @author jceee * @createTime 2015-08-09 */ use NoahBuscher\Macaw\Macaw; Macaw::get('/', 'IndexController@index'); // Macaw::get('/', function() { // echo 'Hello world!'; // }); // Macaw::get('/(:any)', function($slug) { // echo 'The slug is: ' . $slug; // }); Macaw::post('/', function () { echo 'I <3 POST commands!'; }); Macaw::get('/hehe', function () { echo 'hehe'; }); Macaw::get('/mail', 'IndexController@testMail'); // Macaw::error(function() { // echo '404 :: Not Found'; // }); Macaw::$error_callback = function () { throw new Exception("路由无匹配顶 404 not found"); }; Macaw::dispatch();
/** * Created by PhpStorm. * User: meathill * Date: 14/11/16 * Time: 下午3:29 */ use NoahBuscher\Macaw\Macaw; Macaw::get(BASE . 'stat/', 'diy\\controller\\StatController@get_ad_stat'); Macaw::get(BASE . 'stat/(:any)', 'diy\\controller\\StatController@get_the_ad_stat'); Macaw::get(BASE . 'stat/(:any)/(:any)', 'diy\\controller\\StatController@get_ad_daily_stat'); Macaw::get(BASE . 'stat/analyse/', 'diy\\controller\\StatController@get_daily_stat'); Macaw::get(BASE . 'stat/analyse/daily/(:any)', 'diy\\controller\\StatController@get_daily_ad'); Macaw::get(BASE . 'stat/export_payment/', 'diy\\controller\\StatController@export_payment'); Macaw::options(BASE . 'invoice/', 'diy\\controller\\BaseController@on_options'); Macaw::get(BASE . 'invoice/', 'diy\\controller\\InvoiceController@get_list'); Macaw::options(BASE . 'invoice/(:any)', 'diy\\controller\\BaseController@on_options'); Macaw::post(BASE . 'invoice/(:any)', 'diy\\controller\\InvoiceController@create'); Macaw::get(BASE . 'invoice/(:any)', 'diy\\controller\\InvoiceController@init'); Macaw::patch(BASE . 'invoice/(:any)', 'diy\\controller\\InvoiceController@update'); Macaw::delete(BASE . 'invoice/(:any)', 'diy\\controller\\InvoiceController@delete'); Macaw::options(BASE . 'invoice/ad/(:any)', 'diy\\controller\\BaseController@on_options'); Macaw::patch(BASE . 'invoice/ad/(:any)', 'diy\\controller\\InvoiceController@update_invoice_ad'); Macaw::get(BASE . 'invoice/settle/(:any)', 'diy\\controller\\InvoiceController@get_transfer_ad'); Macaw::get(BASE . 'adStat/(:any)/', 'diy\\controller\\ADStatController@get_stat'); Macaw::get(BASE . 'adStat/(:any)/comment/', 'diy\\controller\\ADStatController@get_stat_comments'); Macaw::get(BASE . 'adStat/(:any)/date/(:any)', 'diy\\controller\\ADStatController@get_stat_by_date'); Macaw::get(BASE . 'adStat/(:any)/apk/(:any)', 'diy\\controller\\ADStatController@get_stat_by_apk'); Macaw::get(BASE . 'adStat/(:any)/loc/(:any)', 'diy\\controller\\ADStatController@get_stat_by_loc'); Macaw::get(BASE . 'adStat/(:any)/hour/(:any)', 'diy\\controller\\ADStatController@get_stat_by_hour');
<?php /** * 处理用户相关的请求 * Created by PhpStorm. * User: meathill * Date: 14/11/13 * Time: 下午3:04 */ use NoahBuscher\Macaw\Macaw; Macaw::get(BASE . 'auth/', 'diy\\controller\\UserController@get_info'); Macaw::options(BASE . 'auth/', 'diy\\controller\\BaseController@on_options'); Macaw::delete(BASE . 'auth/', 'diy\\controller\\UserController@logout'); Macaw::post(BASE . 'auth/', 'diy\\controller\\UserController@login'); Macaw::patch(BASE . 'auth/', 'diy\\controller\\UserController@update'); Macaw::get(BASE . 'auth/finance/', 'diy\\controller\\UserController@get_my_finance');
<?php /** * Created by PhpStorm. * User: meathill * Date: 14/12/23 * Time: 下午3:38 */ use NoahBuscher\Macaw\Macaw; Macaw::get(BASE . 'notice/', 'diy\\controller\\NoticeController@get_list'); Macaw::options(BASE . 'notice/(:any)', 'diy\\controller\\BaseController@on_options'); Macaw::delete(BASE . 'notice/(:any)', 'diy\\controller\\NoticeController@delete');
<?php use NoahBuscher\Macaw\Macaw; Macaw::haltOnMatch(); Macaw::get('/home/(:all)/(:num)', 'Controllers\\HomeController@home'); /*Macaw::get('/home', function() { $con = new Controllers\HomeController(); $con->home(); });*/ Macaw::get('/success', function () { echo "成功!"; }); Macaw::get('/asd', function () { echo '根目錄'; }); Macaw::get('/sss/(:num)', function ($fu) { echo 'sss<br>' . $fu; }); /*Macaw::get('/(:all)', function($fu) { echo '未匹配到路由<br>'.$fu; });*/ Macaw::$error_callback = function () { throw new Exception("路由無匹配項 404 Not Found"); }; Macaw::dispatch();
<?php use NoahBuscher\Macaw\Macaw; Macaw::get('/', function () { echo 'Hello world!'; }); Macaw::post('/', function () { echo 'I <3 POST commands!'; }); Macaw::error(function () { echo '404 :: Not Found'; }); Macaw::get('/test', 'TestController@index'); Macaw::dispatch();
<?php use NoahBuscher\Macaw\Macaw; Macaw::get('/', 'HomeController@home'); Macaw::get('/f**k', function () { echo "成功!"; }); Macaw::$error_callback = function () { throw new Exception("路由无匹配项 404 Not Found"); }; Macaw::dispatch();
<?php /** * Created by PhpStorm. * User: huxiuchang * Date: 15-9-17 * Time: 下午1:38 */ use NoahBuscher\Macaw\Macaw; Macaw::get('', 'HomeController@home'); Macaw::get('test', function () { echo "成功!"; }); Macaw::$error_callback = function () { throw new Exception("路由无匹配项 404 Not Found"); }; Macaw::dispatch();
<?php use NoahBuscher\Macaw\Macaw; Macaw::get('', '\\HomeController@home'); Macaw::get('redis', '\\HomeController@redis'); Macaw::$error_callback = function () { throw new Exception("路由无匹配项 404 Not Found"); }; Macaw::dispatch();