In your SubjectsController add method you can pass a new parameter
public function add($gradeId = null) {
// ...
}
When you do your redirect you can just do something like:
return $this->redirect(array('controller' => 'subjects', 'action' => 'add',
$this->Grade->getLastInsertID()));
This will pass the id of the grade to the subjects controller on redirect.
On 1 August 2014 13:49, raji gudivada <[email protected]> wrote:
> HI,
> I am new to cakephp framework.I am using cakephp 2.5.2 version.I
> am trying to develop Content Management System. I used baking concept and
> it generated pages.My pages are Grades,subjects,Chapters,Quizzes,Questions
> and options. For every grade there are so many subjects and for every
> subject there are so many chapters and for every chapter there are so many
> Quizzes like that. Now my requirement is after creating grades(once the
> grade is saved) it should redirect to subjects page(in subject add page)
> with the grade name.I used the following code in gradescontroller
> return $this->redirect(array('controller' => 'subjects', 'action' =>
> 'add'));
> By using the above code i am just redirecting to add page in subjects
> model but i am unable to get grade name in subjects model(add page).
>
> Please Help me
>
>
>
> Thanks in advance.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>
--
Kind Regards
Stephen Speakman
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.