[Agavi-Users] What are the available parameters for AgaviTemplateLayer

11 views
Skip to first unread message

Rafael Guerrero

unread,
Mar 16, 2013, 8:20:07 PM3/16/13
to us...@lists.agavi.org



Hi Guys,


Where is the info about of valid paramteres for AgaviTemplateLayer ?
i want to set a custom template in custom directory for reuse template from multiple modules
i saw the example into the web

// re-use the input template for presenting the errors in the form  
$this->getLayer('content')->setTemplate('Input');

checking the class, i can see the magic metod __call
and the config files ( output_type ) i can see other property

<layer name="decorator">
	<ae:parameter name="directory">%core.template_dir%</ae:parameter>
	<ae:parameter name="template">Master</ae:parameter>
</layer>

i guess that i cant execute 
$layer->setParameter('template', $XXXX); 
or
$layer->setTemplate($XXX);

why the  value for template parameter is a View Name?
can i set a filename ?
Are there other possible values  for the template parameter?
what other properties exist for the AgaviTemplateLayer ?

Thansk for your help

--
Atte
Rafael Ángel Guerrero Godoy

Peter Limbach

unread,
Mar 17, 2013, 5:10:24 AM3/17/13
to Agavi Users Mailing List
the template parameter is not a view name it is the file name maybe this code snippet and the agavi faq could help you

http://mivesto.de/agavi/agavi-faq.html#general_18

https://gist.github.com/pelim/e401c563218b8b47c15a
> Rafael Ángel Guerrero Godoy _______________________________________________
> users mailing list
> us...@lists.agavi.org
> http://lists.agavi.org/mailman/listinfo/users


_______________________________________________
users mailing list
us...@lists.agavi.org
http://lists.agavi.org/mailman/listinfo/users

Steffen Gransow

unread,
Mar 17, 2013, 5:28:52 AM3/17/13
to Agavi Users Mailing List
Hi,

Agavi uses template lookup patterns to get the correct file to render as a template. These lookup patterns can be set in output_types.xml or dynamically.

Please have a look at http://graste.github.com/Agavi-FAQ/agavi-faq.html#general_24 for a small example.

By default agavi looks for localized templates (e.g. en/*.php or *.en_UK.php). You can change the template lookup pattern defaults per layer via the targets parameter.

This gives you a great deal of flexibility as you can do things like in http://graste.github.com/Agavi-FAQ/agavi-faq.html#general_25 where you can define a whole cascade of template lookups.

Kind regards,

Steffen
Reply all
Reply to author
Forward
0 new messages