Must be the s from pluralize with $module['Module']['name'] beeing
empty.
On 8 Nov., 17:57, mbavio <[EMAIL PROTECTED]> wrote:
> Hi, i´m trying to add a menu using renderElement, all works fine
> except that Cake is adding an 's' before the generated code... Is it a
> bug? Or i´m a bug?
>
> Here is the code...
>
> In layout 'backend.ctp':
>
> <ul id="menu">
> <?php echo $this->element('admin_menu');?>
> </ul>
>
> In element 'admin_menu.ctp':
>
> <?php
> $modules = $this->requestAction('modules/createMenu');
> foreach($modules as $module):
> $moduleLabel = $module['Module']['label'];
> $moduleLink = Inflector::pluralize($module['Module']['name']);
> echo "<li>";
> echo $html->link("$moduleLabel", "/admin/$moduleLink/",
> array("id"
> => "menu$moduleLabel"));
> echo "</li>\n";
> endforeach;
> ?>
>
> In controller 'modules_controller':
>
> function createMenu() {
> $modules = $this->Module->findAll();
> if(isset($this->params['requested'])) {
> return $modules;
> }
> $this->set(compact('modules'));
> }
>
> Here is the HTML generated:
>
> <ul id="menu">
> s<li><a href="/cake/admin/generals/"
> id="menuGenerales">Generales</
> a></li>
> <li><a href="/cake/admin/listings/" id="menuPropiedades">Propiedades</
> a></li>
> <li><a href="/cake/admin/helps/" id="menuAyuda">Ayuda</a></li>
> </ul>
>
> The fuck*** s is located after the oppening of the ul...
>
> Anybody has a clue about this?
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---