PHPackages                             iekadou/php\_pjaxr - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. iekadou/php\_pjaxr

ActiveLibrary[Templating &amp; Views](/categories/templating)

iekadou/php\_pjaxr
==================

PJAXR implementation for PHP

v0.1.2(11y ago)1611MITPHPPHP &gt;=5.3.3

Since Mar 30Pushed 11y ago1 watchersCompare

[ Source](https://github.com/iekadou/php-pjaxr)[ Packagist](https://packagist.org/packages/iekadou/php_pjaxr)[ Docs](http://iekadou.com)[ RSS](/packages/iekadou-php-pjaxr/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (1)

php-pjaxr
=========

[](#php-pjaxr)

How to install php-pjaxr?
-------------------------

[](#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?
-----------------------

[](#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')) {

    // Scripts and Stylesheets could be loaded here, no need to reload them when changing the page
