feulf / raintpl

Easy Php Template Engine
https://feulf.github.io/raintpl
188 stars 47 forks source link

creating directories and then compiled file #4

Closed umefarooq closed 13 years ago

umefarooq commented 13 years ago

Hi, i testing raintpl with codeigniter and a very light weight cms get simple, its work fine but when i am using cache it create same set of directory in tmp folder as in codeigniter or in get simple, with codeigniter it is creating application/views/ directories in temp then compiled php file and same thing with get simple, it should create only compiled file, or do you have any reason of creating that.

feulf commented 13 years ago

Hi Umefarooq,

Raintpl only creates the compiled templates into the cache directory. When you use the method raintpl::cache() it also creates the cache in the same cache_dir.

Here how to configure the cache_dir http://www.raintpl.com/Documentation/Documentation-for-PHP-developers/Methods/Configure/#cache_dir

Feel free to write us your improvements on the integration of raintpl with codeigniter, if you can send us a tutorial we might add an article about it on the raintpl website, or on the community forum.

Thanks

2011/4/28 umefarooq < reply@reply.github.com>

Hi, i testing raintpl with codeigniter and a very light weight cms get simple, its work fine but when i am using cache it create same set of directory in tmp folder as in codeigniter or in get simple, with codeigniter it is creating application/views/ directories in temp then compiled php file and same thing with get simple, it should create only compiled file, or do you have any reason of creating that.

Reply to this email directly or view it on GitHub: https://github.com/rainphp/raintpl/issues/4

umefarooq commented 13 years ago

yes its creating compiled template in cache directory but it also creating same directory structure under cache director for example my template is in application/views directory it is also creating same path under cache directory like cache/application/views/compiled_template.php where it should be cache/complied_template.php

feulf commented 13 years ago

Yes, in this way you can have templates with the same name in different directory, and avoid name collision: content/list.html news/list.html article/list.html

However you can configure Rain to save the compiled template inside your template directory, in this way: raintpl::configure("cache_dir", null );

Thanks

2011/4/28 umefarooq < reply@reply.github.com>

yes its creating compiled template in cache directory but it also creating same directory structure under cache director for example my template is in application/views directory it is also creating same path under cache directory like cache/application/views/compiled_template.php where it should be cache/complied_template.php

Reply to this email directly or view it on GitHub: https://github.com/rainphp/raintpl/issues/4#comment_1069708

umefarooq commented 13 years ago

well will be duplication of directory structure, i have used dwoo with CI and it is creating just compiled template in cache folder. saving file with different name.

feulf commented 13 years ago

All right, we'll see if implements an optional compilation approach or either if this approach is better than the actual. I'll keep you update on it. Thanks

feulf commented 13 years ago

Now RainTPL compile the template with md5 naming all into the same cache folder, to avoid name overlapping