Render is very useful if you are using a same view with different
controller
Thanks & Regards
Sourabh Sharma
On Apr 17, 11:34 am, damo <[EMAIL PROTECTED]> wrote:
> thanks for your replies. I will probably just go with the simple
> render option as this seems ridiculously easy to do! What would
Um.
I practically rolled on the floor when I saw the one-liner that did
what you wanted.
The method I gave was a case of using shot-gun to kill a fly.(w.r.t
the case in view)
That method allows you to create reusable elements in cake.
Consider for example that you want to have
thanks for your replies. I will probably just go with the simple
render option as this seems ridiculously easy to do! What would be
the benefit of using the (slightly) more complicated elements option?
I am also trying to figure out how to modify multiple records with a
single form. I see that
vote for this way.
Femi Taiwo's method is perfect, but for simple use, if you just have
these two actions to be rendered in the same view, easier way will be
better in my mind.
On Apr 16, 2:19 am, grigri <[EMAIL PROTECTED]> wrote:
> function viewx() {
> $this->set('students', ...);
> $this->
function viewx() {
$this->set('students', ...);
$this->render('viewall');
}
On Apr 16, 6:52 am, damo <[EMAIL PROTECTED]> wrote:
> Can't seem to figure this one out.
>
> I have two controllers that I would like to use the same view for.
> Here is how they are:
>
> function viewall()
>
Hi Damo,
The way to solve it is by using elements.
Create viewall.ctp and viewx.ctp in the views folder for your
controller.
In viewall.ctp, add this
echo $this->renderElement('studentsinfo');
?>
Add the same thing to viewx.ctp as well.
Finally, create "studentsinfo.ctp" in your vie
Can't seem to figure this one out.
I have two controllers that I would like to use the same view for.
Here is how they are:
function viewall()
{
$this->set('students', $this->Student-
>findAll(array( 'Student.status' => "Active" )));
}
function viewx()
{