Laravel 3.2 Documentation.......................................................................................... 17 Pattern Filters ........................................................................................ HTML helpers. Added ability to set default value on Config::get. Added the ability to add pattern based filters. Improved session ID assignment. Added support for "unsigned" integers in to filters: Route::get('panel', array('before' => 'role:admin', function() { // })); Pattern Filters Sometimes you may want to attach a filter to all requests that begin with a given URI.0 码力 | 139 页 | 1.13 MB | 1 年前3
Laravel 5.0 Documentation
expression, you may use the pattern method. You should define these patterns in the before method of your RouteServiceProvider : $router->pattern('id', '[0-9]+'); Once the pattern has been defined, it $url = Request::url(); Retrieving The Request Method Determining If The Request Path Matches A Pattern Get The Current Request URL Basic Responses Redirects Other Responses Response Macros The most = str_finish('this/string', '/'); // this/string/ Determine if a given string matches a given pattern. Asterisks may be used to indicate wildcards. $value = str_is('foo*', 'foobar'); Convert a string0 码力 | 242 页 | 1.44 MB | 1 年前3
Learning Laravelapplications with a great taste for simplicity. It follows the model–view–controller (MVC) architectural pattern as well as the PSR-2 coding standard, and the PSR-4 autoloading standard. Running a Test Driven Content::class => ContentPolicy::class, ]; Writing Policies Writing Policies follows much the same pattern as writing Gates. The content permission gate can be rewritten as a Policy like this: function and conditional statements inside the blade file. Examples Views: Introduction Views, in an MVC pattern, contain the logic on how to present data to the user. In a web application, typically they are0 码力 | 216 页 | 1.58 MB | 1 年前3
《Slides Dev Web》 03. Laravel
7https://madewithlaravel.com/ 1 Principales fonctionnalités • Routes RESTful • ORM (Eloquent, implémentation du pattern Active Record) • Migrations • Moteur de templates (Blade) • Pagination • Authentification, sessions0 码力 | 8 页 | 224.34 KB | 1 年前3
《Slides Dev Web》 01. Cours devweb
user) ∗ p.ex. : Création d’un film – Respect des conventions et bonnes pratiques – Respect du pattern MVC : Les requêtes doivent passer par toutes les étapes impor- tantes de Laravel ∗ route, validation0 码力 | 7 页 | 129.56 KB | 1 年前3
《Slides Dev Web》02. Introduction aux frameworks PHP
fControl.html 5https://web.archive.org/web/20160316065751/http://blog.mazenod.fr/2010/01/design-pattern-mvc-zoom-sur-la- couche-modele-dal-dao-orm-crud/ 6http://ui-patterns.com/ 2 Figure 1: MVC 30 码力 | 24 页 | 1.03 MB | 1 年前3
Laravel 5.1 中文文档})->where(['id' => '[0-9]+', 'name' => '[a-z]+']); 2.3.1 全局约束 如果想要路由参数在全局范围内被给定正则表达式约束,可以使用 pattern 方法。可以在 RouteServiceProvider 类的 boot 方法中定义约束模式: /** * 定义路由模型绑定,模式过滤器等 * * @param \Illum @translator http://laravelacademy.org */ public function boot(Router $router){ $router->pattern('id', '[0-9]+'); parent::boot($router); } 一旦模式被定义,将会自动应用到所有包含该参数名的路由中。 3、命名路由 命名路由使生成 … 验证字段值不在给定列表中 本文档由 Laravel 学院(LaravelAcademy.org)提供 303 numeric 验证字段必须是数值 regex:pattern 验证字段必须匹配给定正则表达式 注意:使用 regex 模式时,规则必须放在数组中,而不能使用管道分隔符,尤其是正则表达 式中使用管道符号时。 required 验证字段时必须的0 码力 | 307 页 | 3.46 MB | 1 年前3
Laravel 6.0 中文文档'[a-z]+']); 使用正则约束还有一个好处就是避免 了 user/{id} 和 user/{name} 的混淆。 全局约束 如果想要路由参数在全局范围内被给定正则表达式约束,可以使 用 pattern 方法。需要在 RouteServiceProvider 类的 boot 方法 中定义这种约束模式: /** * 定义路由模型绑定,模式过滤器等 * * @param \Illuminate\Routing\Router public function boot() { 本文档由学院君提供 学院君致力于提供优质 Laravel 中文学习资源:https://xueyuanjun.com 179 Route::pattern('id', '[0-9]+'); parent::boot(); } 一旦模式被定义,将会自动应用到所有包含该参数名的路由中: Route::get('user/{id}', function a, [ 'toppings' => [ 'required', Rule::notIn(['sprinkles', 'cherries']), ], ]); not_regex:pattern 验证字段不能匹配给定正则表达式。 本文档由学院君提供 学院君致力于提供优质 Laravel 中文学习资源:https://xueyuanjun.com 352 在底层,该规则使用了 PHP0 码力 | 1442 页 | 14.66 MB | 1 年前3
Laravel 5.6 中文文档'[a-z]+']); 使用正则约束还有一个好处就是避免了 user/{id} 和 user/{name} 的混淆。 全局约束 如果想要路由参数在全局范围内被给定正则表达式约束,可以使用 pattern 方法。需要在 RouteServiceProvider 类的 boot 方法中定义这种约束 模式: /** * 定义路由模型绑定,模式过滤器等 * * @param \I @return void * @translator http://laravelacademy.org */ public function boot() { Route::pattern('id', '[0-9]+'); parent::boot(); } 一旦模式被定义,将会自动应用到所有包含该参数名的路由中: Route::get('user/{id}' Rule::notIn(['sprinkles', 'cherries']), ], ]); numeric 验证字段必须是数值 present 验证字段必须出现在输入数据中但可以为空。 regex:pattern 验证字段必须匹配给定正则表达式。 注:使用 regex 模式时,规则必须放在数组中,而不能使用管道分隔符,尤其是正则表达式中已经使用了管道符号时。 required 验证字段值不能为空,以下情况字段值都为空:0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 5.2 中文文档验证字段的最小值,和字符串、数值、文件字段的 size 规则一起使用 not_in:foo,bar,… 验证字段值不在给定列表中 numeric 验证字段必须是数值 regex:pattern 验证字段必须匹配给定正则表达式 注意:使用 regex 模式时,规则必须放在数组中,而不能使用管道分隔符,尤其是正则表 达式中使用管道符号时。 required 输入字段值不能为空,以下情况字段值都为空:0 码力 | 377 页 | 4.56 MB | 1 年前3
共 11 条
- 1
- 2













