本文整理汇总了PHP中Zend_Controller_Router_Route::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Router_Route::__construct方法的具体用法?PHP Zend_Controller_Router_Route::__construct怎么用?PHP Zend_Controller_Router_Route::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Controller_Router_Route
的用法示例。
在下文中一共展示了Zend_Controller_Router_Route::__construct方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Prepares the route for mapping by splitting (exploding) it
* to a corresponding atomic parts. These parts are assigned
* a position which is later used for matching and preparing values.
*
* @param Zend_Controller_Front $front Front Controller object
* @param string $route Map used to match with later submitted URL path
* @param array $defaults Defaults for map variables with keys as variable names
* @param array $reqs Regular expression requirements for variables (keys as variable names)
* @param Zend_Translate $translator Translator to use for this instance
*/
public function __construct(Zend_Controller_Front $front, $route, $defaults = array(), $reqs = array(), Zend_Translate $translator = null, $locale = null)
{
$this->_front = $front;
$this->_dispatcher = $front->getDispatcher();
$this->_route = $route;
parent::__construct($route, $defaults, $reqs, $translator, $locale);
}
示例2: __construct
public function __construct($route, $defaults = array(), $reqs = array())
{
if (preg_match('/\\.\\w*$/', $route, $matches)) {
$this->_defaultRepresentation = trim($matches[0], '.');
$route = preg_replace('/(\\.\\w*)?$/', '', $route);
}
parent::__construct($route, $defaults, $reqs);
}
示例3: __construct
public function __construct()
{
/* Informações */
$route = $this->getRoute();
$defaults = $this->getDefaults();
/* Construtor */
parent::__construct($route, $defaults);
}
示例4: __construct
/**
* Prepares the route for mapping by splitting (exploding) it
* to a corresponding atomic parts. These parts are assigned
* a position which is later used for matching and preparing values.
*
* @param string $route Map used to match with later submitted URL path
* @param array $defaults Defaults for map variables with keys as variable names
* @param array $reqs Regular expression requirements for variables (keys as variable names)
* @param string $tokenVar Variable name for token
* @param Zend_Translate $translator Translator to use for this instance
*/
public function __construct($route, $defaults = array(), $reqs = array(), $tokenVar = 'token', Zend_Translate $translator = null, $locale = null)
{
parent::__construct($route, $defaults, $reqs, $translator, $locale);
$this->_defaults['module'] = 'download';
if (isset($this->_defaults['token'])) {
throw new \Zend_Controller_Router_Exception("Route cannot have a default token.");
}
if (!in_array($this->_tokenVariable, $this->_variables)) {
throw new \Zend_Controller_Router_Exception("Route must have a token variable inside route.");
}
}
示例5: __construct
/**
* Prepares the route for mapping by splitting (exploding) it
* to a corresponding atomic parts. These parts are assigned
* a position which is later used for matching and preparing values.
*
* @param string $route Map used to match with later submitted URL path
* @param array $variableMap A mapping that maps variables to request parameters
* @param array $defaults Defaults for map variables with keys as variable names
* @param array $reqs Regular expression requirements for variables (keys as variable names)
* @param Zend_Translate $translator Translator to use for this instance
*/
public function __construct($route, $variableMap = array(), $defaults = array(), $reqs = array(), Zend_Translate $translator = null, $locale = null)
{
parent::__construct($route, $defaults, $reqs, $translator, $locale);
$this->_variableMap = $variableMap;
}
示例6: __construct
/**
* Route allowing matching of the HTTP_HOST
*
* $host => ':user.*.*' would match SpotSec.Foo.Com
*
* @param string $host
* @param string $route
* @param array $defaults
* @param array $reqs
*/
public function __construct($host, $route, array $defaults = array(), array $reqs = array())
{
$host = trim($host, $this->_urlDelimiter);
if (!empty($host)) {
// Separate foo.com into array('com', 'foo')
$domains = array_reverse(explode(self::DOMAIN_SEPARATOR, $host));
// Parse out url variables
foreach ($domains as $pos => $part) {
// Check if :var
if (substr($part, 0, 1) == $this->_urlVariable) {
$name = substr($part, 1);
$regex = isset($reqs[$name]) ? $reqs[$name] : $this->_defaultRegex;
// Set to be evaluated later
$this->_hostParts[$pos] = array('name' => $name, 'regex' => $regex);
$this->_hostVars[] = $name;
} else {
$this->_hostParts[$pos] = array('regex' => $part);
// Increment if not a *.*
if ($part !== self::DOMAIN_WILDCARD) {
$this->_hostStaticCount++;
}
}
}
}
parent::__construct($route, $defaults, $reqs);
}
示例7: __construct
/**
* Prepares the route for mapping by splitting (exploding) it
* to a corresponding atomic parts. These parts are assigned
* a position which is later used for matching and preparing values.
*
* @param string $route Map used to match with later submitted URL path
* @param array $defaults Defaults for map variables with keys as variable names
* @param array $reqs Regular expression requirements for variables (keys as variable names)
* @param Zend_Translate $translator Translator to use for this instance
*/
public function __construct($route, $defaults = array(), $reqs = array(), Zend_Translate $translator = null, $locale = null)
{
$route = Axis::config('core/backend/route') . $this->_urlDelimiter . $route;
parent::__construct($route, $defaults, $reqs, $translator, $locale);
}
示例8: __construct
/**
* Process construct param and call parent::__construct() with params
*
* @param array $arguments
*/
public function __construct(array $arguments)
{
parent::__construct($this->_getArgumentValue(self::PARAM_ROUTE, $arguments), $this->_getArgumentValue(self::PARAM_DEFAULTS, $arguments), $this->_getArgumentValue(self::PARAM_REQS, $arguments), $this->_getArgumentValue(self::PARAM_TRANSLATOR, $arguments), $this->_getArgumentValue(self::PARAM_LOCALE, $arguments));
}
示例9: __construct
public function __construct($route = null, $defaults = array(), $reqs = array())
{
$route = 'admin/:module/:action/*';
$defaults = array('module' => 'admin', 'controller' => 'admin', 'action' => 'index');
parent::__construct($route, $defaults);
}