在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):spatie/laravel-pjax开源软件地址(OpenSource Url):https://github.com/spatie/laravel-pjax开源编程语言(OpenSource Language):PHP 100.0%开源软件介绍(OpenSource Introduction):A pjax middleware for LaravelPjax is a jQuery plugin that leverages ajax to speed up the loading time of your pages. It works by only fetching specific html fragments from the server, and client-side updating only happens on certain parts of the page. The package provides a middleware that can return the response that the jQuery plugin expects. There's a Vue-PJAX Adapter equivalent by @barnabaskecskes which doesn't require jQuery. Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website. Support usWe invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products. We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall. InstallationYou can install the package via composer: $ composer require spatie/laravel-pjax Next you must add the // app/Http/Kernel.php
...
protected $middleware = [
...
\Spatie\Pjax\Middleware\FilterIfPjax::class,
]; UsageThe provided middleware provides the behaviour that the pjax plugin expects of the server:
Laravel cache busting tipWhen using Laravel Mix to manage your frontend cache busting, you can use it to your advantage to bust pjax's cache. Simply include the <meta http-equiv="x-pjax-version" content="{{ mix('/css/app.css') }}"> Multiple files: <meta http-equiv="x-pjax-version" content="{{ mix('/css/app.css') . mix('/css/app2.css') }}"> This way, anytime your frontend's cache gets busted, pjax's cache gets automatically busted as well! ChangelogPlease see CHANGELOG for more information what has changed recently. Testing$ composer test ContributingPlease see CONTRIBUTING for details. SecurityIf you've found a bug regarding security please mail [email protected] instead of using the issue tracker. CreditsThe middleware in this package was originally written by Jeffrey Way for the Laracasts-lesson on pjax. His original code can be found in this repo on GitHub. LicenseThe MIT License (MIT). Please see License File for more information. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论