PHPackages                             lare\_team/php\_lare - 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. lare\_team/php\_lare

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

lare\_team/php\_lare
====================

Lare implementation for PHP

v1.0.0(10y ago)0891MITPHPPHP &gt;=5.3.3

Since Jun 26Pushed 9y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (1)

php-lare
========

[](#php-lare)

How to install php-lare?
------------------------

[](#how-to-install-php-lare)

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

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

    ```
    {
        "require": {
            "lare_team/php_lare": ">=1.0.0",
        }
    }
    ```
2. Set the current Lare namespace in your View or anywhere before your templates get rendered:

    ```
    use Lare_Team\Lare\Lare as Lare;
    ...
    Lare::set_current_namespace('Current.Lare.Namespace');
    ```

How do i use php-lare?
----------------------

[](#how-do-i-use-php-lare)

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

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

// Head-Template:
if (!Lare::matches('Lare')) {

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