本文整理匯總了PHP中Illuminate\Routing\Route::getValidators方法的典型用法代碼示例。如果您正苦於以下問題:PHP Route::getValidators方法的具體用法?PHP Route::getValidators怎麽用?PHP Route::getValidators使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Routing\Route
的用法示例。
在下文中一共展示了Route::getValidators方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getValidators
/**
* Get the route validators for the instance.
*
* @return array
*/
public static function getValidators()
{
$validators = parent::getValidators();
foreach ($validators as $key => $validator) {
if ($validator instanceof UriValidator) {
break;
}
}
$validators[] = new AlexaValidator();
return $validators;
}
示例2: handle
/**
* Handle the command.
*/
public function handle()
{
Route::$validators = array_filter(array_merge(Route::getValidators(), [new CaseInsensitiveUriValidator()]), function ($validator) {
return get_class($validator) != UriValidator::class;
});
}
示例3: boot
/**
* 주요 역활은 ModuleValidator 의 boot 를 실행.
*
* @return void
*/
public function boot()
{
$routeValidator = Route::getValidators();
$routeValidator['module']->boot(app('xe.router'), app('xe.menu'), app('xe.theme'), app('xe.site'));
}