Thanks. It wasn't quite the way it works, but I found this workaround:
$this->render("controller/list");
doesn't work,
$this->render("../controller/list");
works, but is quite ugly. So I added a function to app_controller.php:
function renderView($viewname) {
$vex = explode("/",$viewname);
if(count($vex) > 1) {
$this->render("../".$viewname);
} else {
$this->render($viewname);
}
}
So now I can call $this->renderView("controller/list"); or $this-
>renderView("list"); and everything is fine.
On Mar 16, 3:58 pm, "djiize" <[EMAIL PROTECTED]> wrote:
> in the same controller, at the end of each action, you can do:
> $this->render('list') where list is a view of the controller
>
> I don't know if it works with a view from another controller, maybe
> $this->render('controller/list') ?
> If you try, please post your results for the community ;)
>
> On 16 mar, 15:17, "Dominik Schwind" <[EMAIL PROTECTED]> wrote:
>
> > Hi everybody,
>
> > I tried to find the answer to that, but somehow I can't seem to find
> > an elegant solution for my problem.
>
> > I have a view, for simplicity's sake let's say it looks like that:
>
> > <ul>
> > <?php foreach($list as $item){ ?>
> > <li><?php echo $item; ?></li>
> > </ul>
>
> > Now I have many controllers/actions that have no output except that
> > very simple list. Do I really need to define the same view over and
> > over again?
>
> > Thanks,
>
> > Dominik
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---