Development

Changeset 8927

You must first sign up to be able to contribute.

Changeset 8927

Show
Ignore:
Timestamp:
05/13/08 13:31:51 (5 months ago)
Author:
FabianLange
Message:

updated validation example in my-first-project to work fine with editing. Fixes #2898

Files:

Legend:

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

    r8669 r8927  
    405405    public function handleErrorUpdate() 
    406406    { 
    407       $this->forward('comment', 'create'); 
     407      // forward it to edit if the id exists 
     408      if (!$this->getRequestParameter('id')) 
     409      { 
     410        $this->forward('comment', 'create'); 
     411      } 
     412      else 
     413      { 
     414        $this->forward('comment', 'edit'); 
     415      } 
    408416    } 
    409417 
  • doc/branches/1.1/tutorial/my-first-project.txt

    r8669 r8927  
    470470    public function handleErrorUpdate() 
    471471    { 
    472       $this->forward('comment', 'create'); 
     472      // forward it to edit if the id exists 
     473      if (!$this->getRequestParameter('id')) 
     474      { 
     475        $this->forward('comment', 'create'); 
     476      } 
     477      else 
     478      { 
     479        $this->forward('comment', 'edit'); 
     480      } 
    473481    } 
    474482