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


PHP Router::addDelete方法代码示例

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


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

示例1: addRoutes

 public function addRoutes(Router $router)
 {
     $router->add('/' . $this->getApiRootUrl() . '(\\/?)', array('namespace' => $this->getApiControllerRootNamespace(), 'controller' => 'Index', 'action' => 'index'));
     $router->addGet('/' . $this->getApiRootUrl() . '/:controller/:params', array('namespace' => $this->getApiControllerRootNamespace(), 'controller' => 1, 'action' => 'show', 'params' => 2));
     $router->addGet('/' . $this->getApiRootUrl() . '/:controller', array('namespace' => $this->getApiControllerRootNamespace(), 'controller' => 1, 'action' => 'index'));
     $router->addPost('/' . $this->getApiRootUrl() . '/:controller', array('namespace' => $this->getApiControllerRootNamespace(), 'controller' => 1, 'action' => 'create'));
     $router->addOptions('/' . $this->getApiRootUrl() . '/:controller', array('namespace' => $this->getApiControllerRootNamespace(), 'controller' => 1, 'action' => 'options'));
     $router->addOptions('/' . $this->getApiRootUrl() . '/:controller/:params', array('namespace' => $this->getApiControllerRootNamespace(), 'controller' => 1, 'action' => 'options'));
     $router->addDelete('/' . $this->getApiRootUrl() . '/:controller/:params', array('namespace' => $this->getApiControllerRootNamespace(), 'controller' => 1, 'action' => 'delete', 'params' => 2));
     $router->addPut('/' . $this->getApiRootUrl() . '/:controller/:params', array('namespace' => $this->getApiControllerRootNamespace(), 'controller' => 1, 'action' => 'update', 'params' => 2));
 }
开发者ID:bullhorn,项目名称:fast-rest,代码行数:11,代码来源:ApiRoutes.php

示例2: Router

<?php

use Phalcon\Mvc\Router;
$router = new Router();
//Remove trailing slashes automatically
$router->removeExtraSlashes(true);
//main route
$router->add("/", array('controller' => 'index', 'action' => 'index'));
//GET VERB - GET ELEMENT
//Get elemets of relationship. Ex: /department/2/user
$router->addGet('/:controller/:int/([a-zA-Z0-9_-]+)', array('controller' => 1, 'action' => "list", 'id' => 2, 'relationship' => 3));
//Get one element. Ex: /user/2
$router->addGet('/:controller/:int', array('controller' => 1, 'action' => "get", 'id' => 2));
//Get all elements. Ex: /user
$router->addGet('/:controller', array('controller' => 1, 'action' => "list"));
//POST VERB - CREATE ELEMENT
//Create a new element. Ex: /user
$router->addPost('/:controller', array('controller' => 1, 'action' => "save"));
//PUT VERB - UPDATE ELEMENT
//Update a new element. Ex: /user
$router->addPut('/:controller/:int', array('controller' => 1, 'action' => "save", 'id' => 2));
//DELETE VERB - UPDATE ELEMENT
//Update a new element. Ex: /user
$router->addDelete('/:controller/:int', array('controller' => 1, 'action' => "delete", 'id' => 2));
//not founded route
$router->notFound(array('controller' => 'error', 'action' => 'page404'));
$router->setDefaults(array('controller' => 'index', 'action' => 'index'));
return $router;
开发者ID:GeraldoSilva,项目名称:API-REST-PHALCON-PHP,代码行数:28,代码来源:routes.php

示例3: addDelete

 public function addDelete($pattern, $paths = null, $position = Router::POSITION_LAST)
 {
     return parent::addDelete($pattern, $paths, $position);
 }
开发者ID:mattvb91,项目名称:cphalcon,代码行数:4,代码来源:Router.php


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