I assume thats in your layout.php. If so you might want to look at using
a slot.
in layout php you would do something like this:
<?php if(has_slot('module_admin_menu')) ?>
<?php include_slot('module_admin_menu') ?>
<?php else: ?>
<?php include_partial('MainMenu') ?>
<?php endif; ?>
Then in your module template if you want to include a menu other than
MAinMEnu you would do:
<?php slot('module_admin_menu') ?>
<?php include_partial('LicenciasAdminMenu') ?>
<?php end_slot() ?>
this will place the code inside the slot/end_slot calls in the layout
where you called include_slot.
Reynier Perez Mira wrote:
> Thanks for your reply Ant but I resolve the problem using $sf_context var
> from the view layout.php. Now the code is:
>
> $moduleName = $sf_context->getModuleName();
> if (isset($moduleName)) {
> switch ($moduleName) {
> case "geslicsoft":
> include_partial('LicenciasAdminMenu');
> break;
> case "gesrecursos":
> include_partial('LevantamientoAdminMenu');
> break;
> case "gesdessoft":
> include_partial('SoftwareAdminMenu');
> break;
> case "gesmantenimiento":
> include_partial('MantenimientoAdminMenu');
> break;
> }
> } else {
> include_partial('MainMenu');
> }
>
> Now it works perfectly and I don't have anymore the preExecute function in my
> class.
>
> Cheers and thanks for all
> Ing. Reynier Pérez Mira
> Grupo de Soporte al Desarrollo - Dirección Técnica IP
>
>> i think it has to do with assignment in pre execute. I beleive i had
>> trouble with this before as well. For some reason i dont think
>> assignment for the template works in preExecute. I think it only works
>> for assignment within the actions, not within the template. I think
>> this has to do with how preExecute is called and use of __set to
>> magically assing the template variable form within an execution
>> method. Of course i could be completely wrong.
>
> >
--
Ant Cunningham
Graphic Designer | Web Developer
Vector Based Design
[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---