本文整理汇总了PHP中Rule::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Rule::__construct方法的具体用法?PHP Rule::__construct怎么用?PHP Rule::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rule
的用法示例。
在下文中一共展示了Rule::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* @param string $name Name.
* @param int $min Minimum bound.
* @param int $max Maximum bound.
* @param mixed $content Content.
* @param string $nodeId Node ID.
* @return void
*/
public function __construct($name, $min, $max, $content, $nodeId)
{
parent::__construct($name, $content, $nodeId);
$this->_min = $min;
$this->_max = $max;
return;
}
示例2: __construct
/**
* Construct an Equal rule.
*
* @param string $controller
* @param string $match
* @param mixed[] $params
* @param bool $authoritative Whether the rule is authoritative.
*/
public function __construct(string $controller, string $match, array $params = [], bool $authoritative = true)
{
parent::__construct($authoritative);
$this->controller = $controller;
$this->match = $match;
$this->params = $params;
}
示例3: __construct
public function __construct(callable $call, array $args = null, $config = [])
{
parent::__construct($config);
$this->call = $call;
if (!empty($args)) {
$this->args = $args;
}
}
示例4: __construct
/**
* constructor
*
* @return LengthRule
* @author Justin Palmer
**/
public function __construct($min, $max, $message = '%s should be between {min} and {max}.')
{
$this->min = $min;
$this->max = $max;
$message = str_replace('{min}', $min, $message);
$message = str_replace('{max}', $max, $message);
$this->message = '';
parent::__construct($message);
}
示例5: __construct
/**
* Create a rule to get the number from the URI as a parameter.
*
* @param string $controller
* @param string $key The parameter key to store the number in.
* @param string $prefix The prefix to match.
* @param string $suffix An optional suffix to match.
* @param bool $authoritative Whether the rule is authoritative.
*/
public function __construct(string $controller, string $key, string $prefix, string $suffix = '', bool $authoritative = true)
{
parent::__construct($authoritative);
$this->controller = $controller;
$this->key = $key;
$this->prefix = $prefix;
$this->prefixLen = strlen($prefix);
$this->suffix = $suffix;
$this->suffixLen = strlen($suffix);
}
示例6: __construct
public function __construct($fields)
{
parent::__construct('required', $fields);
}
示例7: __construct
public function __construct($pattern)
{
parent::__construct();
$this->pattern = $pattern;
}
示例8: __construct
public function __construct($haystack, $compareIdentical = false, $config = [])
{
parent::__construct($config);
$this->params['haystack'] = $haystack;
$this->params['compareIdentical'] = $compareIdentical;
}
示例9: __construct
public function __construct($fields, $pattern, $mask = '')
{
parent::__construct('pattern', $fields, array('pattern' => $pattern, 'mask' => $mask));
}
示例10: __construct
/**
* @param array
* @param array
* @param array
* @return void
*/
public function __construct(array $selectors = array(''), array $prefixes = array(''), array $statement = NULL)
{
parent::__construct($selectors);
$this->prefixes = $prefixes;
$this->statement = $statement;
}
示例11: __construct
/**
* Construct the Blank URI Rule.
*
* @param string $value Value for a blank URI.
* @param bool $authoritative Whether the rule can definitely give the final route for all URIs that it matches.
*/
public function __construct(string $value, bool $authoritative = true)
{
parent::__construct($authoritative);
$this->value = $value;
}
示例12: __construct
/**
* Construct the right string replacement rule.
*
* @param string $match The string to match on.
* @param string $replacement The string to use as a replacement.
* @param bool $authoritative Whether the rule can definitely give the final route for all URIs that it matches.
*/
public function __construct(string $match, string $replacement, bool $authoritative = false)
{
parent::__construct($authoritative);
$this->match = $match;
$this->replacement = $replacement;
}
示例13: __construct
public function __construct($compareTo, $compareIdentical = false, $config = [])
{
parent::__construct($config);
$this->params['compareTo'] = $compareTo;
$this->params['compareIdentical'] = $compareIdentical;
}
示例14: __construct
public function __construct($fields, $max)
{
parent::__construct('max', $fields, array('max' => $max));
}
示例15: __construct
/**
* KeyValue constructor.
*
* @param callable $callback
* @param string $key
*/
public function __construct(callable $callback, $key)
{
parent::__construct($callback);
$this->key = $key;
}