Hi There,

New to Cake and MVC Frameworks so still trying to get my head wrapped
around these ideas.

I am only allowing users to add content to preset pages: Home | About
| Partners, etc.

I have my page model:

id
title
body
keywords
display_order
created_on
active

Now I get to the confusing part,

I'd rather have the URLS looks like:

domain.com/home or domain.com/
domain.com/about

than

domain.com/pages/view/1

I assume this can be setup in the app/config/routes.php.

In my pages_controller.php instead of using view would I set up
methods called home/about/partners/ etc?
Here is an example method:

function home()
        {
                $this->Page->id = 1;

                $this->set('data', $this->Page->read());

                $this->set( 'menu_data', 
$this->requestAction('/menus/getMenus'));
        }

I'm not sure if this is the correct way to use the controller. Also
I'm not sure if where I am grabbing the menu information I'm doing it
in the best way. I have set up an element called menus.thtml:

<div id="navigation">
<ul>
<?php

foreach( $menu_data as $menu )
{
        $html .= '<li><a href="' . $menu['Menu']['url'] . '">' . $menu['Menu']
['name'] .'</a></li>';
}

echo $html;
?>


</ul>
</div>

And in my default.thtml I call the renderElement method to pull in the
menu.

Anyway Thanks in advance, mark


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to