《Slides Dev Web》02. Introduction aux frameworks PHP
dispatch des requêtes grâce aux routes – (bootstrap, ré-écriture des URL, …) • Object Relational Mapping5 – Active Record, Table Data Gateway, Data Mapper, … • UI Patterns6 MVC for webdev Conventions structure réelle de notre base de données et offrir une interface orientée objet. Un Object-Relational Mapping ou ORM(3) dans le jargon. query( "SELECT * FROM `personnes` R::load('personnes', $id); // ou Doctrine $personne = $om->find('Personne', $id); Object-Relational Mapping • RedBean23 • Doctrine24 (ORM, ODM) • Eloquent ORM25 • etc.26 Une bibliothèque qui va créer ce0 码力 | 24 页 | 1.03 MB | 1 年前3
Laravel 3.2 Documentationaction would accept the posted form, validate, and either redirect to the login form with an error message or redirect your user to their dashboard. Class Auto Loading keeps you from having to maintain 3.2.4 Replace the laravel folder. Laravel 3.2.4 Speed up many to many eager loading mapping. Tweak the Eloquent::changed() method. Various bug fixes and improvements. Upgrading links, current protocol is used. Fix bug in Eloquent auth driver. Added format method to message container. Upgrading From 3.2 Replace the laravel folder. Laravel 3.2 Added to_array0 码力 | 139 页 | 1.13 MB | 1 年前3
Laravel 5.0 Documentation
instance and flash data to the session in a single method chain: return redirect('user/login')->with('message', 'Login Failed'); You may wish to redirect the user to their previous location, for example, after is_null($value); }); As you can see, the Collection class allows you to chain its methods to perform fluent mapping and reducing of the underlying array. In general, every Collection method returns an entirely DispatchesCommands trait: $this->dispatchFrom('Command\Class\Name', $request); Dispatching Commands Mapping Command Properties From Requests This method will examine the constructor of the command class it0 码力 | 242 页 | 1.44 MB | 1 年前3
Learning Laravelproperty which maps your eloquent models to their authorisation policies. All you need to do add the mapping to the array. protected $policies = [ Content::class => ContentPolicy::class, ]; Writing related to a post by doing the following: $post = Post::find(1); $commentToAdd = new Comment(['message' => 'This is a comment.']); https://riptutorial.com/ 76 $post->comments()->save($commentToAdd); $post->comments()->saveMany([ new Comment(['message' => 'This a new comment']), new Comment(['message' => 'Me too!']), new Comment(['message' => 'Eloquent is awesome!']) ]); Alternatively0 码力 | 216 页 | 1.58 MB | 1 年前3
Laravel 5.1 中文文档消息接口,包括请求和响应。如果你想要获取 PSR-7 请求实例, 首先需要安装一些库,Laravel 使用 Symfony HTTP Message Bridge 组件将典型的 Laravel 请求和响应转化为 PSR-7 兼容的实现: composer require symfony/psr-http-message-bridge composer require zendframework/zend-diactoros s 安装完这些库之后,你只需要在路由或控制器中通过对请求类型进行类型提示就可以获取 PSR-7 请求: use Psr\Http\Message\ServerRequestInterface; Route::get('/', function (ServerRequestInterface $request) { // }); 如果从路由或控制器返回的是 PSR-7 响应实例,则其将会自动转化为 Post 模型,你可以从关联关系的 save 方法直接插入 Comment 而不是手动设置 Comment 的 post_id 属性: $comment = new App\Comment(['message' => 'A new comment.']); $post = App\Post::find(1); $comment = $post->comments()->save($comment);0 码力 | 307 页 | 3.46 MB | 1 年前3
Laravel 5.2 中文文档消息接口,包括请求和响应。如果你想要获取 PSR-7 请求实 例,首先需要安装一些库,Laravel 使用 Symfony HTTP Message Bridge 组件将典型的 Laravel 请求和响应转化为 PSR-7 兼容的实现: composer require symfony/psr-http-message-bridge composer require zendframework/zend-diactoros ros 安装完这些库之后,你只需要在路由或控制器中通过对请求类型进行类型提示就可以获取 PSR-7 请求: use Psr\Http\Message\ServerRequestInterface; 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 47 Route::get('/' Post 模型,你可以从关联关系的 save 方法直接插入 Comment 而不是手动设置 Comment 的 post_id 属性: $comment = new App\Comment(['message' => 'A new comment.']); $post = App\Post::find(1); $post->comments()->save($comment); 注意我们没有用动态属性方式访问0 码力 | 377 页 | 4.56 MB | 1 年前3
Laravel 6.0 中文文档方法获取授权策略的响应,然 后再通过响应示例的 message() 方法获取授权消息: $response = Gate::inspect('view', $flight); if ($response->allowed()) { // 用户被授权可以访问航班... } if ($response->denied()) { echo $response->message(); } 此外,当在路由或控制器中使用 response. * * @param bool $allowed * @param string $message * @param mixed $code * @return void */ public function __construct($allowed, $message = '', $code = null) Illuminate\Contracts\Auth\Access\Gate Artisan 命令 down 即可: php artisan down 还可以提供 message 和 retry 选项给 down 命令。message 的值用 于显示或记录自定义消息,而 retry 的值用于设置 HTTP 请求头 的 Retry-After: php artisan down --message="Upgrading Database" --ret ry=60 即使在维护模式下,也可以通过0 码力 | 1442 页 | 14.66 MB | 1 年前3
Laravel 5.6 中文文档Artisan 命令 down 即可: php artisan down 还可以提供 message 和 retry 选项给 down 命令。message 的值用于显示或记录自定义消息,而 retry 的值用于设置 HTTP 请求头的 Retry- After: php artisan down --message="Upgrading Database" --retry=60 要关闭维护模式,开启站点,对应的 标准的请求实例而不是 Laravel 请求实例,首先需要安装一些 库。Laravel 可以使用 Symfony HTTP Message Bridge 组件将典型的 Laravel 请求和响应转化为兼容 PSR-7 接口的实现: composer require symfony/psr-http-message-bridge composer require zendframework/zend-diactoros os 安装完这些库之后,只需要在路由或控制器中通过对请求示例进行类型提示就可以获取 PSR-7 请求: use Psr\Http\Message\ServerRequestInterface; Route::get('/', function (ServerRequestInterface $request) { // }); 对比下 Request 实例和 ServerRequestInterface0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 5.3 中文文档WelcomeMessage extends Mailable { use Queueable, SerializesModels; /** * Build the message. * * @return $this */ public function build() 本文档由 Laravel 学院(LaravelAcademy 消息接口,包括请求和响应。如果你想要获取 PSR-7 请求实例,首先 需要安装一些库,Laravel 使用 Symfony HTTP Message Bridge 组件将典型的 Laravel 请求和响 应转化为 兼容 PSR-7 的实现: composer require symfony/psr-http-message-bridge composer require zendframework/zend-diactoros 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 138 use Psr\Http\Message\ServerRequestInterface; Route::get('/', function (ServerRequestInterface $request) { //0 码力 | 691 页 | 9.37 MB | 1 年前3
《Slides Dev Web》 06. HTTP & AJAX
entêtes HTTP25 – Champ Status – Code d’erreur • En PHP header("Status: Message d'erreur explicite", true, 400); • Afficher le message au client : myXHR.getResponseHeader("Status"); 22https://fetch.spec0 码力 | 11 页 | 91.09 KB | 1 年前3
共 11 条
- 1
- 2













