feulf / raintpl3

The easiest Template Engine for PHP
https://feulf.github.io/raintpl
258 stars 57 forks source link

Multiple template directory. #103

Closed kargnas closed 11 years ago

kargnas commented 11 years ago

What about this feature to the philosophy of Rain? In smarty, I did use this feature for mobile. (But there are some bugs.)

keskad commented 11 years ago

I was confused too when i was starting using RainTPL but solved it within a wrapper (https://github.com/webnull/panthera/blob/master/lib/templates.class.php#L543) Thats why i want absolute paths support in RainTPL and created a pull request.

This feature unfortunately increases IO usage by looking for a template in additional directories.

feulf commented 11 years ago

Someone already implemented the multi directory loading, if not yet in master I'll search in which branch it is and merge into master. Thanks

On Mon, Aug 5, 2013 at 5:43 PM, Damian Kęska notifications@github.comwrote:

I was confused too when i was starting using RainTPL but solved it within a wrapper ( https://github.com/webnull/panthera/blob/master/lib/templates.class.php#L543 ) Thats why i want absolute paths support in RainTPL and created a pull request.

This feature unfortunately increases IO usage by looking for a template in additional directories.

— Reply to this email directly or view it on GitHubhttps://github.com/rainphp/raintpl3/issues/103#issuecomment-22114808 .

kargnas commented 11 years ago

@webnull Is that wrapping solution only apply to draw in phpClass drawing?

https://github.com/kargnas/raintpl3/commit/36fc71424deb6cc9d7154f82aca45c8e6424c011

@webnull @rainphp What about this? Please review this code, i will pull request. No need to make absolute path.

keskad commented 11 years ago

I think you can pull. The code looks fine, but variable names sometimes have weird names :smile:

I dont understand what you mean by draw in phpClass drawing. I have a wrapper "pantheraTemplate" and I use it as $panthera->template->push('var', 'value'); $panthera -> template -> display('test.tpl'); and it can use Smarty or RainTPLv3 or any diffirent template engines without need to change anything in application code. And yes, it's fast. Whole framework in admin panel loads in ~0.01s (~110 requests per seconds on 6 years old Intel CoreDuo @ 1.6GHz) with db, sql, caching, template engine, user & groups, metas, configuration, and locales. Everything is done by wrappers etc. i think it must be enough fast solution.

kargnas commented 11 years ago

@webnull Thank you, I will pull request with some example. It seems to explain through code.

kargnas commented 11 years ago

https://github.com/rainphp/raintpl3/pull/104