Re: pageTitle removal in 1.3: what about static pages?
Thanks, already did it this way in static pages. Hope it won't break in future versions. On May 8, 1:11 am, mark_story wrote: > Well its assumed that if you have the variable to set in the view, you > could just reference that. View::set() has no magical way of adding > to the local execution scope. Remember, cake is constrained by what > PHP can do :) If for some reason you can't use a local variable, try > looking in $this->viewVars['title_for_layout'] Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: pageTitle removal in 1.3: what about static pages?
Well its assumed that if you have the variable to set in the view, you could just reference that. View::set() has no magical way of adding to the local execution scope. Remember, cake is constrained by what PHP can do :) If for some reason you can't use a local variable, try looking in $this->viewVars['title_for_layout'] -Mark On May 6, 9:54 pm, Sergei wrote: > Actually this->set(title_for_layout) in the *view* sets this variable > ONLY for layout. It doesn't available in the view. Maybe this is a bug > or something? > > On Apr 29, 3:13 pm, John Andersen wrote: > > > It is written in the migration section, that you should use the views > > method $this->set instead. > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with > their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: pageTitle removal in 1.3: what about static pages?
Actually this->set(title_for_layout) in the *view* sets this variable ONLY for layout. It doesn't available in the view. Maybe this is a bug or something? On Apr 29, 3:13 pm, John Andersen wrote: > It is written in the migration section, that you should use the views > method $this->set instead. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: pageTitle removal in 1.3: what about static pages?
Well it does and doesn't work for the controller - it is not very cool, but a simple switch($path[$count - 1]) { case 'home': $title_for_layout = 'Your title for home page here'; break; ... Would work and allow you to set any number of custom titles in PagesController. It isn't perfect, but it does work and give you some control. WoJo On Apr 29, 8:50 am, Sergei wrote: > yes indeed. I thought that's only for controller. > > On Apr 29, 3:13 pm, John Andersen wrote: > > > > > > > It is written in the migration section, that you should use the views > > method $this->set instead. > > Seehttp://book.cakephp.org/view/1566/View-and-Helpers > > Enjoy, > > John > > > On Apr 29, 7:54 am, Sergei wrote: > > > > Hi, > > > > just began to work with 1.3 and noticed that there is no way to set > > > page title ($title_for_layout) from the *view*. > > > > Yes it's possible to set it from controller action, but what about > > > static pages for Pages controller? Pages controller has only one > > > action 'display'. So setting title from controller doesn't "work" for > > > many pages! > > > > But.. I found the solution to set title from view: > > > > viewVars['title_for_layout']="Page title" ?> > > > > I think that was a bad decision to remove the pageTitle manipulation > > > in views. Now we have to use a hack. > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers > > > with their CakePHP related questions. > > > > You received this message because you are subscribed to the Google Groups > > > "CakePHP" group. > > > To post to this group, send email to cake-php@googlegroups.com > > > To unsubscribe from this group, send email to > > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > > athttp://groups.google.com/group/cake-php?hl=en > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with > their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: pageTitle removal in 1.3: what about static pages?
yes indeed. I thought that's only for controller. On Apr 29, 3:13 pm, John Andersen wrote: > It is written in the migration section, that you should use the views > method $this->set instead. > Seehttp://book.cakephp.org/view/1566/View-and-Helpers > Enjoy, > John > > On Apr 29, 7:54 am, Sergei wrote: > > > > > Hi, > > > just began to work with 1.3 and noticed that there is no way to set > > page title ($title_for_layout) from the *view*. > > > Yes it's possible to set it from controller action, but what about > > static pages for Pages controller? Pages controller has only one > > action 'display'. So setting title from controller doesn't "work" for > > many pages! > > > But.. I found the solution to set title from view: > > > viewVars['title_for_layout']="Page title" ?> > > > I think that was a bad decision to remove the pageTitle manipulation > > in views. Now we have to use a hack. > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with > their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: pageTitle removal in 1.3: what about static pages?
It is written in the migration section, that you should use the views method $this->set instead. See http://book.cakephp.org/view/1566/View-and-Helpers Enjoy, John On Apr 29, 7:54 am, Sergei wrote: > Hi, > > just began to work with 1.3 and noticed that there is no way to set > page title ($title_for_layout) from the *view*. > > Yes it's possible to set it from controller action, but what about > static pages for Pages controller? Pages controller has only one > action 'display'. So setting title from controller doesn't "work" for > many pages! > > But.. I found the solution to set title from view: > > viewVars['title_for_layout']="Page title" ?> > > I think that was a bad decision to remove the pageTitle manipulation > in views. Now we have to use a hack. > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with > their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
pageTitle removal in 1.3: what about static pages?
Hi, just began to work with 1.3 and noticed that there is no way to set page title ($title_for_layout) from the *view*. Yes it's possible to set it from controller action, but what about static pages for Pages controller? Pages controller has only one action 'display'. So setting title from controller doesn't "work" for many pages! But.. I found the solution to set title from view: viewVars['title_for_layout']="Page title" ?> I think that was a bad decision to remove the pageTitle manipulation in views. Now we have to use a hack. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en