I have a component that uses $View->renderLayout() in a similar
fashion to the EmailComponent->__renderTemplates() function.
However, whenever I create a new view instance ( $View =& new
View($this->Controller); ) in my component, any css or javascript in
$scripts_for_layout does not get included when the browser page is
rendered - even if they are added afterwards. This may be because the
component's view gets registered in the ClassRegistry as 'view' in
it's constructor.
The only workaround I can find is the call
ClassRegistry::removeObject('view'); after I have finished with the
view instance in my component. Cake will then automatically create a
new view instance for the browser rendering...
When I get chance, I'll try to test the EmailComponent, but would be
interested in the views (pardon the pun) of anyone who has experienced
this and has found a different workaround.
~GreyCells
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---