Development

Changeset 16643

You must first sign up to be able to contribute.

Changeset 16643

Show
Ignore:
Timestamp:
03/26/09 22:41:00 (4 years ago)
Author:
hugo.hamon
Message:

[doc] fixed typo and closed ticket #6119

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • doc/branches/1.2/tutorial/my-first-project.txt

    r15396 r16643  
    298298     * @param sfRequest $request A request object 
    299299     */ 
    300     public function executeIndex($request) 
     300    public function executeIndex(sfWebRequest $request) 
    301301    { 
    302302    } 
     
    341341 
    342342    [php] 
    343     public function executeShow($request) 
     343    public function executeShow(sfWebRequest $request) 
    344344    { 
    345345      $this->blog_post = BlogPostPeer::retrieveByPk($request->getParameter('id')); 
     
    400400 
    401401    [php] 
    402     <?php echo link_to('Add a comment', 'comment/edit?post_id='.$blog_post->getId()) ?> 
     402    <?php echo link_to('Add a comment', 'comment/new?post_id='.$blog_post->getId()) ?> 
    403403 
    404404The `link_to()` helper creates a hyperlink pointing to the 
     
    426426>**Note**: For more details on the form framework, you are advised to read the 
    427427[Forms Book](http://www.symfony-project.org/book/forms/1_2/en/). 
     428 
     429Then, the post id has to be automatically set from the request parameter passed in the URL. This  
     430can be done by replacing the `executeNew()` method of the `comment` module by the following one. 
     431 
     432    [php] 
     433    class commentActions extends sfActions 
     434    { 
     435      public function executeNew(sfWebRequest $request) 
     436      { 
     437        $this->form = new BlogCommentForm(); 
     438        $this->form->setDefault('blog_post_id', $request->getParameter('post_id')); 
     439      } 
     440 
     441      // ... 
     442    } 
    428443 
    429444After you have made this change, you will now be able to add a comment directly to a