A couple of things: first, I'd use the html link helper to make links. <?php echo $html->link('Test', '/controller/action'); ?>
Second, it should be /controller/action, not controller/action. Third, pagesController is a built-in part of cake, so you can't have a controller called pages. In reference to your routes question, no, you shouldn't have to set a route for every link you make. If you follow the /controller/action model, things should just work. hydra12 On Jan 21, 2:45 pm, "Novice Programmer" <[EMAIL PROTECTED]> wrote: > Hello hydra, > > you got my point right. But here i have a little query regarding routes as > well. Please bear with me as i am new to cake. > > lets say that i have a layout default.thtml. and i am having a link in the > default page which points to some other page(which happens to be the cake > page itself). Let the other controller be PagesController. now here is how i > wrote the link to the pages controller's index action in default.thtml. > > <a href = "pages/index">Test </a> > > This above link does not redirect to the index action and finally to the > index.thtml of PagesController untill i define the entry saying > > $Route->connect('/pages/*', array('controller' => 'pages', 'action' => > 'index')); in routes.php > > Is this how cake designed to work? Am i supposed to route every such entry > in routes.php? > > Any help is highly appreciated. > > Thanks. > > On 1/21/08, hydra12 <[EMAIL PROTECTED]> wrote: > > > > > > > > > I'm still unsure what you are wanting. Are all of these new pages > > going to be cake pages, or are they going to be static pages? If they > > are cake pages, then your two points are correct. Sometimes it is > > easier to make a new layout. > > > On Jan 19, 1:37 am, "Novice Programmer" <[EMAIL PROTECTED]> > > wrote: > > > Hello, > > > > Actually i am trying to port a legacy application. In the page there are > > a > > > lot of forwards thro html <a href> tag. Now what i was thinking was that > > > what is the best way to convert these tags new layouts, or the same > > layout > > > with different views loading at different time. After i researched i > > came to > > > following conclusions: > > > > 1. If the layout is quite different, then new layout would be better > > > otherwise existing layout would be cluttered with code. > > > 2. If the layout is not that different, then new view in the same layout > > is > > > a better choice. > > > > Please correct me if i am wrong. > > > > Thanks. > > > > On 1/19/08, bright_o <[EMAIL PROTECTED]> wrote: > > > > > What exactly are you trying to accomplish? > > > > > On Jan 18, 1:39 pm, "Novice Programmer" <[EMAIL PROTECTED]> > > > > wrote: > > > > > Hello guys, > > > > > > What is the best way to handle the redirections such as <a href = " > > > > > mypage.htm">.... </a> in cake php. Do i define new layout for the > > page > > > > > mypage or should i have seperate view and load it in the exisiting > > > > layout > > > > > only. The new page to be loaded is quite different from the another > > > > page. > > > > > > -- > > > > > Thanks & Regards, > > > > > Novice (http://ishuonweb.wordpress.com/). > > > > -- > > > Thanks & Regards, > > > Novice (http://ishuonweb.wordpress.com/). > > -- > Thanks & Regards, > Novice (http://ishuonweb.wordpress.com/).- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---