Hello.

I am still trying to figure out the best way to design with cake. In
general almost all my pages have mixed blocks from different
controllers on each page. (like CNN) So elements are really something
that I would like to use! It is nice that I can create very small
modules and final put it all together in static pages.

1. Elements requestAction from controllers.
2. Pages consist of fixed formatting and elements(menu, info etc).

My problem:
Page About us has e.g. two elements: menu and info.So.
What if element menu should interact with element info? I select
something in the menu - Page reloads and displays the select item in
element B! I don't understand how I should pull this off?

Best regards.
Asbjørn Morell.


PAGE:
/pages/home.thtml
<?php

echo $this->renderElement('about_us\menu');

echo $this->renderElement('about_us\info');

echo $this->renderElement('cases\newest');

?>

CONTROLLER:
/controllers/about_us_controller
function menu() {
        return $this->Text->findAll(null, array('id', 'headline'));
}

ELEMENT:
/views/elements/about_us/menu
<?php
foreach ($this->requestAction('/texts/menu') as $text)
        {
        echo '
        <li>'.$html->link($text['Text']['headline'],
        '/about_us/view/' . $text['Text']['id']).'</li>';
        }
?>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to