当前位置: 首页>>代码示例>>PHP>>正文


PHP Route::controller方法代码示例

本文整理汇总了PHP中Route::controller方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::controller方法的具体用法?PHP Route::controller怎么用?PHP Route::controller使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Route的用法示例。


在下文中一共展示了Route::controller方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setRoutes

 public static function setRoutes($routes)
 {
     foreach ($routes as $c) {
         if (class_exists($c->action)) {
             if ($c->route_name == '/') {
                 $routable = \Route::getInspector()->getRoutable($c->action, '');
             } else {
                 $routable = \Route::getInspector()->getRoutable($c->action, $c->route_name);
             }
             foreach ($routable as $k => $v) {
                 if ($v[0]['verb'] == 'get') {
                     if (isset($v[1])) {
                         if ($v[1]['plain'] == '') {
                             \Route::get('/', ['as' => '/', 'uses' => $c->action . '@' . $k]);
                         } else {
                             \Route::get($v[1]['plain'], ['as' => $v[1]['plain'], 'uses' => $c->action . '@' . $k]);
                         }
                         continue;
                     }
                     \Route::get($v[0]['plain'], ['as' => $v[0]['plain'], 'uses' => $c->action . '@' . $k]);
                 } elseif ($v[0]['verb'] == 'post') {
                     if (preg_match('/[\\s\\S]+\\/index/', $v[0]['plain'])) {
                         $v[0]['plain'] = str_replace('/index', '', $v[0]['plain']);
                     }
                     \Route::post($v[0]['plain'], ['as' => $v[0]['plain'], 'uses' => $c->action . '@' . $k]);
                 }
             }
             if ($c->other_route != '') {
                 \Route::controller($c->other_route, $c->action);
             }
         }
     }
 }
开发者ID:hramose,项目名称:Laravel-Admin5,代码行数:33,代码来源:AdminRoute.php

示例2: returnRoutes

 public static function returnRoutes($prefix = null)
 {
     $class = __CLASS__;
     Route::post('admin/gallery/ajax-order-save', array('as' => 'gallery.order', 'uses' => $class . "@postAjaxOrderSave"));
     Route::group(array('before' => 'auth', 'prefix' => $prefix), function () use($class) {
         Route::get($class::$group . '/manage', array('uses' => $class . '@getIndex'));
         Route::controller($class::$group, $class);
     });
 }
开发者ID:Grapheme,项目名称:amway,代码行数:9,代码来源:admin_galleries.controller.php

示例3: returnRoutes

 public static function returnRoutes($prefix = null)
 {
     $class = __CLASS__;
     $name = self::$name;
     $group = self::$group;
     Route::group(array('before' => 'auth', 'prefix' => 'admin'), function () use($class, $name, $group) {
         Route::controller($group . '/' . $name, $class);
     });
 }
开发者ID:Grapheme,项目名称:doktornarabote,代码行数:9,代码来源:admin_users.controller.php

示例4: routes

 public function routes()
 {
     R::group(['namespace' => 'Controllers'], function () {
         R::controller('thanks/{ref}', 'Thanks');
         R::controller('webhooks', 'Webhooks');
         R::controller('other', 'Other');
         R::controller('/', 'Root');
     });
 }
开发者ID:stanmay,项目名称:unflare,代码行数:9,代码来源:Provider.php

示例5: setMethod

 private static function setMethod($need = null)
 {
     if (is_null($need)) {
         return;
     }
     $method = trim($need, '/');
     $arr = explode('@', $method);
     self::$method = $arr[1];
     self::$controller = $arr[0];
 }
开发者ID:phumaster,项目名称:fw,代码行数:10,代码来源:Route.php

示例6: R

/**
 * Quickly define a new route.
 * A new Route can be defined in two ways:
 *
 * either by passing all of the route parameters as parameters to R():
 *   R('','TestController','index','GET');
 *
 * or by using the methods of the Route class:
 *   R('')->controller("TestController")->action("index")->on("GET");
 *
 * (thanks to:  Rafael S. Souza <rafael.ssouza [__at__] gmail.com>)
 */
function R($pattern)
{
    if (count($args = func_get_args()) == 4) {
        $r = new Route($args[0]);
        $r->controller($args[1])->action($args[2])->on($args[3]);
        return $r;
    } else {
        return new Route($pattern);
    }
}
开发者ID:scottdavis,项目名称:nimble,代码行数:22,代码来源:helper.php

示例7: handle

 public function handle(Route $route)
 {
     $factory = $this->factory($route->controller());
     $controller = $factory->invoke();
     $controller->context = $this->httpContext;
     $view = $this->view($controller, $this->action($route->action()), $route->parameters());
     $view->context = $this->httpContext;
     $this->header($view);
     $this->render($view);
 }
开发者ID:johnnysacrifice,项目名称:emmweesee,代码行数:10,代码来源:mvc-handler.php

示例8: returnRoutes

 public static function returnRoutes($prefix = null)
 {
     $class = __CLASS__;
     $name = self::$name;
     $group = self::$group;
     Route::group(array('before' => 'auth', 'prefix' => 'admin'), function () use($class, $name, $group) {
         Route::post($group . '/' . $name, array('as' => 'modules.change', 'uses' => $class . '@postModule'));
         Route::post($name . '/ajax-order-save', array('as' => 'modules.order', 'uses' => $class . "@postAjaxOrderSave"));
         Route::controller($group . '/' . $name, $class);
     });
 }
开发者ID:Grapheme,项目名称:doktornarabote,代码行数:11,代码来源:admin_modules.controller.php

示例9: returnRoutes

 public static function returnRoutes($prefix = null)
 {
     $class = __CLASS__;
     $name = self::$name;
     $group = self::$group;
     Route::group(array('before' => 'auth', 'prefix' => 'admin'), function () use($class, $name, $group) {
         Route::get($group . '/' . $name . '/edit/{mod}', $class . '@getEdit');
         Route::get($group . '/' . $name . '/save/{mod}', $class . '@postSave');
         Route::controller($group . '/' . $name, $class);
     });
     ModTemplates::addTplDir();
     ## Site layout dir
 }
开发者ID:Grapheme,项目名称:doktornarabote,代码行数:13,代码来源:admin_tplEditor.controller.php

示例10: R

/**
 * Quickly define a new route.
 * A new Route can be defined in two ways:
 *  @package NimblePack
 * either by passing all of the route parameters as parameters to R():
 *   R('','TestController','index','GET');
 *
 * or by using the methods of the Route class:
 *   R('')->controller("TestController")->action("index")->on("GET")->short_url('test_index');
 *
 * (thanks to:  Rafael S. Souza <rafael.ssouza [__at__] gmail.com>)
 */
function R()
{
    $args = func_get_args();
    switch (count($args)) {
        case 0:
        case 2:
        case 3:
            throw new NimbleException("Incorrect number of parameters for R()");
        case 1:
            return new Route($args[0]);
        case 4:
            $r = new Route($args[0]);
            $r->controller($args[1])->action($args[2])->on($args[3]);
            return $r;
        case 5:
            $r = new Route($args[0]);
            $r->controller($args[1])->action($args[2])->on($args[3])->short_url($args[4]);
            return $r;
    }
}
开发者ID:scottdavis,项目名称:nimblize,代码行数:32,代码来源:helper.php

示例11:

<?php

/*
|----------------------------------------------
| App Routes
|----------------------------------------------
*/
Route::controller("welcom", "welcoms");
开发者ID:amineabri,项目名称:ARFiesta,代码行数:8,代码来源:Routes.php

示例12: function

<?php

Route::group(['prefix' => 'search', 'namespace' => 'Modules\\Search\\Http\\Controllers'], function () {
    //Route::get('/', 'SearchController@index');
    Route::controller('/', 'SearchController');
});
开发者ID:jaggman,项目名称:lrv-module-search,代码行数:6,代码来源:routes.php

示例13: function

<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
// Création des routes pour le contrôleur implicite SondageController
Route::controller('sondage', 'SondageController');
Route::get('/', function () {
    return view('welcome');
});
开发者ID:nathix86,项目名称:laravel-oc-partie-1-exo,代码行数:17,代码来源:routes.php

示例14: function

<?php

Route::group(['namespace' => '\\CMS', 'prefix' => 'cms'], function () {
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    // LOGIN
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    get('/', ['uses' => 'LoginController@show', 'as' => 'cms.login']);
    post('/', ['uses' => 'LoginController@postLogin', 'as' => 'cms.login.post']);
    get('/logout', ['uses' => 'LoginController@logout', 'as' => 'cms.logout']);
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    // DASHBOARD
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    get('/', ['uses' => 'MenuController@index', 'as' => 'cms.menu']);
    Route::group(['prefix' => 'dashboard'], function () {
        get('/', ['uses' => 'DashboardController@index', 'as' => 'cms.dashboard']);
    });
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    // NEWS
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    Route::controller('news', 'NewsController', ['getIndex' => 'cms.news', 'getCreate' => 'cms.news.create', 'postStore' => 'cms.news.store', 'getEdit' => 'cms.news.edit', 'getUpdate' => 'cms.news.update', 'getShow' => 'cms.news.show', 'putDelete' => 'cms.news.delete']);
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    // SETTINGS
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    Route::group(['prefix' => 'settings'], function () {
        // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
        // WEBSITE
        // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
        Route::controller('website', 'WebsiteController', ['getIndex' => 'cms.website', 'getCreate' => 'cms.website.create', 'postStore' => 'cms.website.store', 'getEdit' => 'cms.website.edit', 'getUpdate' => 'cms.website.update', 'getShow' => 'cms.website.show', 'putDelete' => 'cms.website.delete']);
    });
});
开发者ID:ThunderID,项目名称:Halo,代码行数:30,代码来源:routes_cms.php

示例15:

<?php

Route::controller('confirmation', '\\Aamant\\EmailConfirmation\\ConfirmationController');
开发者ID:aamant,项目名称:email-confirmation,代码行数:3,代码来源:routes.php


注:本文中的Route::controller方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。