在 Laravel 5.1 中使用 Pjax

WBOY
Release: 2016-06-20 12:45:34
Original
997 people have browsed it

在 Laravel 5.* 的版本中,使用 Pjax 实现无刷新效果,以及酷炫的进度条

项目地址:https://github.com/yccphp/pjax-for-laravel-5

效果

安装

1.在 composer.json 的 require里 加入

"yuanchao/pjax-for-laravel-5": "dev-master"
Copy after login

2.执行 composer update

3.在config/app.php 的 providers 数组加入一条

YuanChao\Pjax\EndaPjaxServiceProvider::class
Copy after login

4.在 Kernel 的 $middleware 数组里添加

\YuanChao\Pjax\EndaPjaxMiddleware::class,
Copy after login

5.执行 php artisan vendor:publish

使用

必须先引入 jquery

必须先引入 jquery

必须先引入 jquery

在布局文件中,插入以下代码

@include('pjax::pjax')
Copy after login
最后

求 star

求 star

求 star

欢迎加入laravel学习小组交流:365969825

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!