template inheritance

139 views
Skip to first unread message

Rain

unread,
Feb 14, 2011, 5:25:55 PM2/14/11
to raintpl
Many template engines implements this feature. What do you think about?

Hernan Lozano

unread,
Feb 15, 2011, 12:58:32 PM2/15/11
to rai...@googlegroups.com
Hi,

What kind of inheritance do you mean? 

If it is the one using the blocks on the template file, i've never used it.

To merge two or more templates I just create two raintpl objects, one for the main layout, and other for each column or innerbody content. The child layouts are assigned to a variable inside the parent layout.

$main = new Raintpl();
$child_tpl = new Raintpl();
$child_tpl -> assign('all assignments here');
$main -> assign('inner_body',$tpl->draw($child_tpl, true));
echo $main->draw('main');
Since i've never been any close to this tool, i can't say much. But every time you create a new template, you have to assign the child's variables and the main's variables. You know what I mean?




On Mon, Feb 14, 2011 at 7:25 PM, Rain <rainel...@gmail.com> wrote:
Many template engines implements this feature. What do you think about?

Federico Ulfo

unread,
Feb 15, 2011, 1:20:10 PM2/15/11
to rai...@googlegroups.com
Hi,

yes, that's exactly how to use rain.

I was just wondering if somebody here use the inheritance and if it should be implemented in rain.

thanks,
Federico




2011/2/15 Hernan Lozano <hern...@gmail.com>

Hernan Lozano

unread,
Feb 15, 2011, 1:38:40 PM2/15/11
to rai...@googlegroups.com
yeah, i would touch that at the moment,
It would implicate adding complexity and ugly tags to raintpl, that should stay simple, doing more with less ;D

Stephan Krauß

unread,
Feb 17, 2011, 6:00:33 AM2/17/11
to rai...@googlegroups.com
Hello !

I need urgent an example how i can integrate the rainTPL
in the zend framework.

Pleeeeeeeeeeeeeeeeeease help !


Your sincerly

Stephan Krau�

Federico Ulfo

unread,
Feb 17, 2011, 6:07:47 AM2/17/11
to rai...@googlegroups.com
Ok. I start within now,
just what do you need for?


2011/2/17 Stephan Krauß <in...@suppenterrine.de>
Stephan Krauß

Rain

unread,
Feb 17, 2011, 12:08:09 PM2/17/11
to raintpl
Here the integration of RainTPL into Zend Framework:
http://www.raintpl.com/News/2011/02/17/Integrating-Rain-TPL-into-Zend/

Best Regards,
Federico

On Feb 17, 12:07 pm, Federico Ulfo <rainelemen...@gmail.com> wrote:
> Ok. I start within now,
> just what do you need for?
>
> 2011/2/17 Stephan Krauß <i...@suppenterrine.de>

Stephan Krauß

unread,
Feb 18, 2011, 2:27:08 AM2/18/11
to rai...@googlegroups.com
Hello !

I'm so happy :-) .
Thank you for the quick help.
In the next days i will test raintpl in the zend framework.
On the next wek i start a new project and i think rain is a great help.

I have read teh example how i can integrate rain.
Is there an special way to merge 2 templates ?
See => Inheritance.

I will define a master template. In zend is this the layout.
And i will put in same regions of the layout children templates.

Your sincerly

Stephan

Federico Ulfo

unread,
Feb 18, 2011, 5:00:56 AM2/18/11
to rai...@googlegroups.com
great.


Rain doesn't have inheritance. The best solution in Rain to load few templates into a layout, is to draw all single templates, get their outputs, and than assign them to the layout template. Easy.

Anyway, I'd like to spend few words about the inheritance.

I don't like it, adding OOP logic into templates, defeats the purpose of template engine, to simplify the work of designers.
With inheritance, designers can handle the template-flow, choosing the layouts to loads.
IMHO, the presentation layer should print the output, the application should choose what templates to loads, do you agree?

Behind all above, seems like the inheritance is a new trend in template engines, so I'm taking it in serious consideration for next versions.

Any comments are welcome.


2011/2/18 Stephan Krauß <in...@suppenterrine.de>

etor...@gmail.com

unread,
May 9, 2013, 5:59:40 PM5/9/13
to rai...@googlegroups.com
No inheritance yet?

Federico Ulfo

unread,
May 9, 2013, 7:16:52 PM5/9/13
to raintpl
Nope, but I'm considering it


No inheritance yet?
--
unsuscribe at raintpl+u...@googlegroups.com
 
---
You received this message because you are subscribed to the Google Groups "raintpl" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raintpl+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages