本文整理汇总了PHP中Symfony\Component\Routing\Route::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::__construct方法的具体用法?PHP Route::__construct怎么用?PHP Route::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Routing\Route
的用法示例。
在下文中一共展示了Route::__construct方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Create a new Route object.
*
* @param string $method
* @param string $path
*
* @param mixed $handler
*/
public function __construct($method, $path, $handler)
{
// Set Route name
$this->name = $this->extractFromHandler('as', $handler);
// Init Parent
parent::__construct($path, ['action' => $this->extractFromHandler('uses', $handler, null, true)], $this->extractFromHandler('requirements', $handler, []), $this->extractFromHandler('options', $handler, []), $this->extractFromHandler('domain', $handler, ''), $this->extractFromHandler('schemes', $handler, []), [$method]);
}
示例2: __construct
public function __construct($path, array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array(), $condition = '')
{
parent::__construct($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
$this->accessPublic();
$this->secureByLoginSecurity();
$this->setDefault(RouteAttribute::LOCALE, null);
}
示例3: __construct
public function __construct($pattern, array $defaults = array(), array $requirements = array(), array $options = array())
{
parent::__construct($pattern, $defaults, $requirements, $options);
// Set default format to HTML if none is explicitly set
if (!isset($defaults['_format'])) {
$this->setFormat($this->_defaultFormat);
}
}
示例4: __construct
public function __construct($path = '/', array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array())
{
parent::__construct($path, $defaults, $requirements, $options, $host, $schemes, $methods);
}
示例5: __construct
/**
* Constructor.
*
* Available options:
*
* * compiler_class: A class name able to compile this route instance (RouteCompiler by default)
*
* @param string $path The path pattern to match
* @param array $defaults An array of default parameter values
* @param array $requirements An array of requirements for parameters (regexes)
* @param array $options An array of options
* @param string $host The host pattern to match
* @param string|array $schemes A required URI scheme or an array of restricted schemes
* @param string|array $methods A required HTTP method or an array of restricted methods
*/
public function __construct($path = '/', array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array())
{
// overridden constructor to make $path optional
parent::__construct($path, $defaults, $requirements, $options, $host, $schemes, $methods);
}
示例6: __construct
public function __construct($pattern = '', array $defaults = array(), array $requirements = array(), array $options = array())
{
parent::__construct($pattern, $defaults, $requirements, $options);
}
示例7: __construct
/**
* Constructor.
*
* Available options:
*
* * compiler_class: A class name able to compile this route instance (RouteCompiler by default)
*
* @param string $name Name of the route
* @param string $path The path pattern to match
* @param array $defaults An array of default parameter values
* @param array $requirements An array of requirements for parameters (regexes)
* @param array $options An array of options
* @param string $host The host pattern to match
* @param string|array $schemes A required URI scheme or an array of restricted schemes
* @param string|array $methods A required HTTP method or an array of restricted methods
*
* @api
*/
public function __construct($name, $path, array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array())
{
$this->setName($name);
parent::__construct($path, $defaults, $requirements, $options, $host, $schemes, $methods);
$this->updatedAt = new \DateTime();
}
示例8: __construct
/**
* @param string $method
* @param array $path
* @param string|callable $action
*/
public function __construct($method, $path, $action)
{
parent::__construct($path, ['action' => $action], [], [], null, [], $method, null);
}
示例9: __construct
/**
* Constructor.
*/
public function __construct()
{
parent::__construct($this->routePattern);
$this->setDefaults(array());
}
示例10: __construct
public function __construct()
{
parent::__construct('/');
$this->children = array();
}
示例11: __construct
/**
* Constructor.
*
* Available requirements:
* - HTTP_<<headername>> : HTTP header value required
*
* @param string $pattern The pattern to match
* @param array $defaults An array of default parameter values
* @param array $requirements An array of requirements for parameters (regexes)
* @param array $options An array of options
*/
public function __construct($pattern, array $defaults = array(), array $requirements = array(), array $options = array())
{
parent::__construct($pattern, $defaults, $requirements, $options);
$this->_addHeaderRequirements();
}