This is exactly what the PagesController does.
Move your views/news directory to views/pages/news
Edit /app/config/routes.php, and add this line:
Router::connect('/news/*', array('controller' => 'pages', 'action' =>
'display', 'news'));
That should do it!
On Feb 12, 3:48 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Feb 12, 2008 10:45 AM, cronet <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > is there a possibility to create views without a controller ?
>
> > e.g. I have a view directory "news". I want to display all views
> > automatically without the controller function!
> > If someone request http://domain.com/news/abc it should render
> > abc.ctp (but without crating the controller function).
>
> > Is this possible?
>
> You might want to investigate the use of custom routing to do what you
> want. However, you cannot have a View without a Controller to render
> it.
>
> --
> Chris Hartjes
> Internet Loudmouth
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---