定制 tc/pjax-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tc/pjax-bundle

最新稳定版本:v1.0.2

Composer 安装命令:

composer require tc/pjax-bundle

包简介

TcPjaxBundle

README 文档

README

Latest Stable Version

SensioLabsInsight

Integrates Pjax to Symfony

Installation

composer require tc/pjax-bundle

Enable the bundle in your AppKernel.php

$bundles = array(
    // ...
    
    new Tc\Bundle\Pjax\TcPjaxBundle(),
    
    // ...
);

Include the scripts in your templates

<script src="{{ asset('bundles/tcpjax/vendor/jquery.js') }}"></script>
<script src="{{ asset('bundles/tcpjax/vendor/jquery.pjax.js') }}"></script>
<script src="{{ asset('bundles/tcpjax/js/tc-pjax.js') }}"></script>

{# OR #}

{% javascripts
 '@TcPjaxBundle/Resources/public/vendor/jquery.js'
 '@TcPjaxBundle/Resources/public/vendor/jquery.pjax.js'
 '@TcPjaxBundle/Resources/public/js/tc-pjax.js'
%}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}

Usage

You will now want to create a pjax container, and different layouts for full and pjax

base.html.twig

<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  <meta charset="utf-8">
  <title>{% block title %}{% endblock %}</title>
</head>
<body>
{% block body %}{% endblock %}
<script src="{{ asset('bundles/tcpjax/vendor/jquery.js') }}"></script>
<script src="{{ asset('bundles/tcpjax/vendor/jquery.pjax.js') }}"></script>
<script src="{{ asset('bundles/tcpjax/js/tc-pjax.js') }}"></script>
</body>
</html>

base-pjax.html.twig

<title>{% block title %}{% endblock %}</title>
{% block body_inner %}{% endblock %}

your-layout.html.twig

{% extends pjax('#your-layout', '::base.html.twig', '::base-pjax.html.twig') %}

{% block title %}Your Title{% endblock %}

{% block body %}

	<div {{ pjaxContainer('#your-layout', app.debug) }}>

    {% block body_inner %}

      <h1>Your Content</h1>

    {% endblock %}

	</div>

{% endblock %}

License

TcPjaxBundle is licensed with the MIT license.

See LICENSE for more details.

统计信息

  • 总下载量: 118
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-08