[symfony-users] Re: Issues with Create/Edit/Save actions
Dan Grossman a écrit : > Which is why I suggested instead appending to the title in the view > layer where it's known. You're right, plus I didn't realize title attribute could be easily handled at view time, with a dedicated helper :) Thanks for your help, guys ++ -- Nicolas Perriaulthttp://www.clever-age.com Clever Age - conseil en architecture technique GSM: +33 6 60 92 08 67 Tél: +33 1 53 34 66 10 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Issues with Create/Edit/Save actions
Does that work? I recall $this->getResponse()->getTitle() always being blank from the controller (action classes). It makes sense since which view template is going to be shown isn't known until the action method has already returned (it could return success, failure, or set a different template entirely). Which is why I suggested instead appending to the title in the view layer where it's known. Nicolas Dhomont wrote: > $this->getResponse()->setTitle($this->getResponse()->getTitle().'textToBeAppendedToFormerTitle'); > > You can put this code into : > * preExecute() : your title will be modified for every action inside > the module > * executeMyAction() : title modified only for myAction > > I'm not sure it solves your controller issue. > > :-) > > Nicolas > > > Nicolas Perriault a écrit : >> Nicolas Dhomont wrote: >> >> >>> public function executeCreate() >>> { >>> * $this->getResponse()->setTitle('blah'); >>> * return $this->forward('content', 'edit'); >>> } >>> >> >> BTW is there a simple way to append a string to an existing title >> (defined in the view.yml file) in the response ? My problem is that in >> the controller the sfResponse::getTitle method always returns an empty >> string... :( >> >> ++ > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Issues with Create/Edit/Save actions
$this->getResponse()->setTitle($this->getResponse()->getTitle().'textToBeAppendedToFormerTitle'); You can put this code into : * preExecute() : your title will be modified for every action inside the module * executeMyAction() : title modified only for myAction I'm not sure it solves your controller issue. :-) Nicolas Nicolas Perriault a écrit : > Nicolas Dhomont wrote: > > >> public function executeCreate() >> { >> * $this->getResponse()->setTitle('blah'); >> * return $this->forward('content', 'edit'); >> } >> > > BTW is there a simple way to append a string to an existing title > (defined in the view.yml file) in the response ? My problem is that in > the controller the sfResponse::getTitle method always returns an empty > string... :( > > ++ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Issues with Create/Edit/Save actions
Not from the controller. But you can make this string you want to append available to the view from the controller, then in the view, print out a tag which contains the title from view.yml and your extra string instead of using the helper method for printing a title. Ex: getContext()->getResponse()->getTitle(); ?> Nicolas Perriault wrote: > Nicolas Dhomont wrote: > > >> public function executeCreate() >> { >> * $this->getResponse()->setTitle('blah'); >> * return $this->forward('content', 'edit'); >> } >> > > BTW is there a simple way to append a string to an existing title > (defined in the view.yml file) in the response ? My problem is that in > the controller the sfResponse::getTitle method always returns an empty > string... :( > > ++ > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Issues with Create/Edit/Save actions
Nicolas Dhomont wrote: > public function executeCreate() > { > * $this->getResponse()->setTitle('blah'); > * return $this->forward('content', 'edit'); > } BTW is there a simple way to append a string to an existing title (defined in the view.yml file) in the response ? My problem is that in the controller the sfResponse::getTitle method always returns an empty string... :( ++ -- Nicolas Perriaulthttp://www.clever-age.com Clever Age - conseil en architecture technique GSM: +33 6 60 92 08 67 Tél: +33 1 53 34 66 10 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Issues with Create/Edit/Save actions
This might help you : public function executeCreate() { * $this->getResponse()->setTitle('blah'); * return $this->forward('content', 'edit'); } :-) Nicolas Greg Freeman a écrit : > When you use the propel admin generator, it creates these three > actions create, save and edit. Create and save forward to edit. This > all works fine but my question is If I want to set some action > specific variables how do I do this? since after forwarding they are > lost. > > For example if I want to set the title in the create action to be > available in the editSuccess template > > public function executeCreate() > { > $this->title = 'blah'; > return $this->forward('content', 'edit'); > } > > After I forward to the edit action $title is lost and will not be > available in the editSuccess template. > > Is there a better way to organize these actions instead of the way > propel does it? > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---