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


PHP Router::patch方法代码示例

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


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

示例1: registerMacros

 protected function registerMacros(Router $router)
 {
     $router->macro('module', function ($module, $sortable = false) use($router) {
         $controller = ucfirst($module) . 'Controller';
         if ($sortable) {
             $router->patch("{$module}/changeOrder", $controller . '@changeOrder');
         }
         $router->resource($module, $controller);
     });
     $this->app['paginateroute']->registerMacros();
 }
开发者ID:spatie-custom,项目名称:blender,代码行数:11,代码来源:RouteServiceProvider.php

示例2: patch

 /**
  * Register a new PATCH route with the router.
  *
  * @param string $uri
  * @param \Closure|array|string $action
  * @return \Illuminate\Routing\Route 
  * @static 
  */
 public static function patch($uri, $action)
 {
     return \Illuminate\Routing\Router::patch($uri, $action);
 }
开发者ID:satriashp,项目名称:tour,代码行数:12,代码来源:_ide_helper.php

示例3: patch

 /**
  * Register a new PATCH route with the router.
  *
  * @param  string                 $uri
  * @param  \Closure|array|string  $action
  *
  * @return \Illuminate\Routing\Route|void
  */
 public function patch($uri, $action)
 {
     return $this->router->patch($uri, $action);
 }
开发者ID:arcanedev,项目名称:support,代码行数:12,代码来源:RouteRegister.php

示例4: registerMacros

 /**
  * @param \Illuminate\Routing\Router $router
  */
 protected function registerMacros(Router $router)
 {
     $router->macro('redirect', function ($url, $action) use($router) {
         $router->get($url, function () use($action) {
             return redirect()->action($action);
         });
     });
     $router->macro('module', function ($slug, $className, $sortable = false) use($router) {
         if ($sortable) {
             $router->patch("{$slug}/changeOrder", "{$className}Controller@changeOrder");
         }
         $router->resource($slug, "{$className}Controller");
     });
     $router->macro('articleList', function ($technicalNamePrefix, $action) use($router) {
         $articles = app(ArticleRepository::class)->getWithTechnicalNameLike($technicalNamePrefix);
         $router->get(app()->getLocale() . '/' . fragment_slug("navigation.{$technicalNamePrefix}"), function () use($articles) {
             return redirect(route("{$articles->first()->technical_name}"));
         })->name($technicalNamePrefix);
         $articles->map(function ($article) use($technicalNamePrefix, $action, $router) {
             $router->get(app()->getLocale() . '/' . fragment_slug("navigation.{$technicalNamePrefix}") . '/' . $article->url, $action)->name("{$article->technical_name}");
         });
     });
 }
开发者ID:bjrnblm,项目名称:blender,代码行数:26,代码来源:RouteServiceProvider.php

示例5: addPatchResourceUpdate

 /**
  * Add the update method for a resourceful route.
  *
  * @param  string  $name
  * @param  string  $base
  * @param  string  $controller
  * @return void
  */
 protected function addPatchResourceUpdate($name, $base, $controller)
 {
     $uri = $this->getResourceUri($name) . '/{' . $base . '}';
     $this->router->patch($uri, $controller . '@update');
 }
开发者ID:mubassirhayat,项目名称:Laravel51-starter,代码行数:13,代码来源:ResourceRegistrar.php

示例6: patch

 /**
  * Registers a new PATCH route.
  *
  * @param string $uri The URI (e.g. / or /users or /users/{param}/friends).
  * @param string $controller The path to the controller handling the resource (e.g. UsersController::class or App\Http\Controllers\UsersController).
  * @param string $method Name of the method inside the controller that will handle the request.
  * @return $this
  */
 public function patch($uri, $controller, $method)
 {
     $this->router->patch($uri, $controller . '@' . $method);
     return $this;
 }
开发者ID:jarischaefer,项目名称:hal-api,代码行数:13,代码来源:RouteHelper.php

示例7: map

 public function map(Router $router)
 {
     // Admin Index
     $router->get('admin', ['as' => 'admin.index', 'middleware' => ['auth', 'admin', 'csrf'], 'uses' => 'Admin\\BaseController@getIndex']);
     $router->group(['prefix' => 'admin/settings', 'middleware' => ['auth', 'admin', 'csrf']], function () use($router) {
         $router->get('/', ['as' => 'admin.settings', 'uses' => 'Admin\\BaseController@getSettings']);
         $router->post('/', ['uses' => 'Admin\\BaseController@postSettings']);
     });
     $router->group(['prefix' => 'admin/users', 'middleware' => ['auth', 'admin', 'csrf']], function () use($router) {
         // View All Accounts on System
         $router->get('/', ['as' => 'admin.users', 'uses' => 'Admin\\UserController@getIndex']);
         // View Specific Account
         $router->get('/view/{id}', ['as' => 'admin.users.view', 'uses' => 'Admin\\UserController@getView']);
         // View Specific Account
         $router->post('/view/{id}', ['uses' => 'Admin\\UserController@updateUser']);
         // Delete an Account Matching an ID
         $router->delete('/view/{id}', ['uses' => 'Admin\\UserController@deleteUser']);
         // Show Create Account Page
         $router->get('/new', ['as' => 'admin.users.new', 'uses' => 'Admin\\UserController@getNew']);
         // Handle Creating New Account
         $router->post('/new', ['uses' => 'Admin\\UserController@postNew']);
     });
     // Server Routes
     $router->group(['prefix' => 'admin/servers', 'middleware' => ['auth', 'admin', 'csrf']], function () use($router) {
         // View All Servers
         $router->get('/', ['as' => 'admin.servers', 'uses' => 'Admin\\ServersController@getIndex']);
         // View Create Server Page
         $router->get('/new', ['as' => 'admin.servers.new', 'uses' => 'Admin\\ServersController@getNew']);
         // Handle POST Request for Creating Server
         $router->post('/new', ['uses' => 'Admin\\ServersController@postNewServer']);
         // Assorted Page Helpers
         $router->post('/new/get-nodes', ['uses' => 'Admin\\ServersController@postNewServerGetNodes']);
         $router->post('/new/get-ips', ['uses' => 'Admin\\ServersController@postNewServerGetIps']);
         $router->post('/new/service-options', ['uses' => 'Admin\\ServersController@postNewServerServiceOptions']);
         $router->post('/new/service-variables', ['uses' => 'Admin\\ServersController@postNewServerServiceVariables']);
         // End Assorted Page Helpers
         // View Specific Server
         $router->get('/view/{id}', ['as' => 'admin.servers.view', 'uses' => 'Admin\\ServersController@getView']);
         // Database Stuffs
         $router->post('/view/{id}/database', ['as' => 'admin.servers.database', 'uses' => 'Admin\\ServersController@postDatabase']);
         // Change Server Details
         $router->post('/view/{id}/details', ['uses' => 'Admin\\ServersController@postUpdateServerDetails']);
         // Change Server Details
         $router->post('/view/{id}/container', ['as' => 'admin.servers.post.container', 'uses' => 'Admin\\ServersController@postUpdateContainerDetails']);
         // Change Server Details
         $router->post('/view/{id}/startup', ['as' => 'admin.servers.post.startup', 'uses' => 'Admin\\ServersController@postUpdateServerStartup']);
         // Rebuild Server
         $router->post('/view/{id}/rebuild', ['uses' => 'Admin\\ServersController@postUpdateServerToggleBuild']);
         // Change Build Details
         $router->post('/view/{id}/build', ['uses' => 'Admin\\ServersController@postUpdateServerUpdateBuild']);
         // Suspend Server
         $router->post('/view/{id}/suspend', ['uses' => 'Admin\\ServersController@postSuspendServer']);
         // Unsuspend Server
         $router->post('/view/{id}/unsuspend', ['uses' => 'Admin\\ServersController@postUnsuspendServer']);
         // Change Install Status
         $router->post('/view/{id}/installed', ['uses' => 'Admin\\ServersController@postToggleInstall']);
         // Delete [force delete]
         $router->delete('/view/{id}/{force?}', ['uses' => 'Admin\\ServersController@deleteServer']);
     });
     // Node Routes
     $router->group(['prefix' => 'admin/nodes', 'middleware' => ['auth', 'admin', 'csrf']], function () use($router) {
         // View All Nodes
         $router->get('/', ['as' => 'admin.nodes', 'uses' => 'Admin\\NodesController@getIndex']);
         // Add New Node
         $router->get('/new', ['as' => 'admin.nodes.new', 'uses' => 'Admin\\NodesController@getNew']);
         $router->post('/new', ['uses' => 'Admin\\NodesController@postNew']);
         // View Node
         $router->get('/view/{id}', ['as' => 'admin.nodes.view', 'uses' => 'Admin\\NodesController@getView']);
         $router->post('/view/{id}', ['uses' => 'Admin\\NodesController@postView']);
         $router->delete('/view/{id}/allocation/{ip}/{port?}', ['uses' => 'Admin\\NodesController@deleteAllocation']);
         $router->get('/view/{id}/allocations.json', ['as' => 'admin.nodes.view.allocations', 'uses' => 'Admin\\NodesController@getAllocationsJson']);
         $router->post('/view/{id}/allocations', ['as' => 'admin.nodes.post.allocations', 'uses' => 'Admin\\NodesController@postAllocations']);
         // View Deploy
         $router->get('/view/{id}/deploy', ['as' => 'admin.nodes.deply', 'uses' => 'Admin\\NodesController@getScript']);
         $router->delete('/view/{id}', ['as' => 'admin.nodes.delete', 'uses' => 'Admin\\NodesController@deleteNode']);
     });
     // Location Routes
     $router->group(['prefix' => 'admin/locations', 'middleware' => ['auth', 'admin', 'csrf']], function () use($router) {
         $router->get('/', ['as' => 'admin.locations', 'uses' => 'Admin\\LocationsController@getIndex']);
         $router->delete('/{id}', ['uses' => 'Admin\\LocationsController@deleteLocation']);
         $router->patch('/{id}', ['uses' => 'Admin\\LocationsController@patchLocation']);
         $router->post('/', ['uses' => 'Admin\\LocationsController@postLocation']);
     });
     // API Routes
     $router->group(['prefix' => 'admin/api', 'middleware' => ['auth', 'admin', 'csrf']], function () use($router) {
         $router->get('/', ['as' => 'admin.api', 'uses' => 'Admin\\APIController@getIndex']);
         $router->get('/new', ['as' => 'admin.api.new', 'uses' => 'Admin\\APIController@getNew']);
         $router->post('/new', ['uses' => 'Admin\\APIController@postNew']);
         $router->delete('/revoke/{key?}', ['as' => 'admin.api.revoke', 'uses' => 'Admin\\APIController@deleteRevokeKey']);
     });
     // Database Routes
     $router->group(['prefix' => 'admin/databases', 'middleware' => ['auth', 'admin', 'csrf']], function () use($router) {
         $router->get('/', ['as' => 'admin.databases', 'uses' => 'Admin\\DatabaseController@getIndex']);
         $router->get('/new', ['as' => 'admin.databases.new', 'uses' => 'Admin\\DatabaseController@getNew']);
         $router->post('/new', ['uses' => 'Admin\\DatabaseController@postNew']);
         $router->delete('/delete/{id}', ['as' => 'admin.databases.delete', 'uses' => 'Admin\\DatabaseController@deleteDatabase']);
         $router->delete('/delete-server/{id}', ['as' => 'admin.databases.delete-server', 'uses' => 'Admin\\DatabaseController@deleteServer']);
     });
     // Service Routes
     $router->group(['prefix' => 'admin/services', 'middleware' => ['auth', 'admin', 'csrf']], function () use($router) {
//.........这里部分代码省略.........
开发者ID:Pterodactyl,项目名称:Panel,代码行数:101,代码来源:AdminRoutes.php

示例8: patch

 public function patch($uri, $action, $as = null)
 {
     return parent::patch($uri, $this->packAction($action, $as));
 }
开发者ID:KinaMarie,项目名称:laravel-5-base-app-support,代码行数:4,代码来源:Router.php


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