lare_team/php_lare
最新稳定版本:v1.0.0
Composer 安装命令:
composer require lare_team/php_lare
包简介
Lare implementation for PHP
关键字:
README 文档
README
How to install php-lare?
There are just two steps needed to install php-lare:
-
Add php-lare to your composer.json:
{ "require": { "lare_team/php_lare": ">=1.0.0", } } -
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?
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')) { <html> <head> // Scripts and Stylesheets could be loaded here, no need to reload them when changing the page <script... <link... <?php } else { ?> <lare-head> <?php } ... if (!Lare::matches('Lare')) { </head> <?php } else { ?> </lare-head> <?php } // Body-Template: if (!Lare::matches('Lare')) { <body> <header>...</header> <div id="site"> ... <div id="page"> <?php } else { ?> <lare-body> <?php } // Render everything you need in the page container. if (!Lare::matches('Lare')) { ?> </div> ...//site content could still be here <footer></footer> </div> </body> <?php } else { ?> </lare-body> <?php } ?>
If this seems to be too complex for you, try twig in combination with twig-lare for templating.
What do you need for php-lare?
Projects using php-lare
If you are using php-lare, please contact us, and tell us in which projects you are using it. Thank you!
Happy speeding up your php project!
For further information read php-lare on iekadou.com
统计信息
- 总下载量: 89
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-06-26