定制 iekadou/php_pjaxr 二次开发

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

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

iekadou/php_pjaxr

最新稳定版本:v0.1.2

Composer 安装命令:

composer require iekadou/php_pjaxr

包简介

PJAXR implementation for PHP

关键字:

README 文档

README

How to install php-pjaxr?

There are just two steps needed to install php-pjaxr:

  1. Add php-pjaxr to your composer.json:

    {
        "require": {
            "iekadou/php_pjaxr": ">=0.1.1",
        }
    }
  2. Set the current Pjaxr namespace in your View or anywhere before your templates get rendered:

    use Iekadou\Pjaxr\Pjaxr as Pjaxr;
    ...
    Pjaxr::set_current_namespace('Pjaxr.Home');

How do i use php-pjaxr?

This example seems to show a huge overhead, actually only the if-else tags make it that big.

// View:
if (!Pjaxr::matches('Pjaxr')) {
    // Do everything you need only for the whole site.
}
if (!Pjaxr::matches('Pjaxr.Home')) {
    // Do everything you need to handle the home page.
}

// Head-Template:
if (!Pjaxr::matches('Pjaxr')) {
    <html>
    <head>
    // Scripts and Stylesheets could be loaded here, no need to reload them when changing the page
    <script...
    <link...
<?php } else { ?>
    <pjaxr-head>
<?php }
...
if (!Pjaxr::matches('Pjaxr')) {
    </head>
<?php } else { ?>
    </pjaxr-head>
<?php }

// Body-Template:
if (!Pjaxr::matches('Pjaxr')) {
    <body>
        <header>...</header>
        <div id="site">
            ...
            <div id="page">
<?php } else { ?>
    <pjaxr-body>
<?php }

// Render everything you need in the page container.

if (!Pjaxr::matches('Pjaxr')) { ?>
            </div>
            ...//site content could still be here
            <footer></footer>
        </div>
    </body>
<?php } else { ?>
    </pjaxr-body>
<?php } ?>

If this seems to be too complex for you, try twig in combination with twig-pjaxr for templating.

What do you need for php-pjaxr?

  1. PHP >= 5.3.29
  2. jquery-pjaxr

Projects using php-pjaxr

  1. pjaxr.io

If you are using twig-pjaxr, please contact me, and tell me in which projects you are using it. Thank you!

Happy speeding up your php project!

For further information read php-pjaxr on iekadou.com

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固