Are you trying to use more one view for an action? That kid of goes
against the MVC concept.
You might want to rethink how you handle your view.

On Jul 30, 7:19 am, safl <[EMAIL PROTECTED]> wrote:
> This seems like the thing to do.
>
> I have one issue... only the first $this->render(...,'ajax'); Is
> actually rendered, the rest arent? In my controller i got for each
> action:
>
> ...
>                 if ($this->RequestHandler->isAjax())
>                         $this->RequestHandler->renderAs($this, 'ajax');
> ...
>
> So the action works on It's own with default layout, and the first
> action i request is rendered "inline".... so what am i missing here?
>
> On Jul 29, 12:05 am, rtconner <[EMAIL PROTECTED]> wrote:
>
> > I think this would be likely best case
>
> > $this->viewPath = 'anothercontrollers_folder'; // not needed if file
> > is in controllers viewPath already
> > $this->render('view_file', 'ajax'); // don't use extention ('ajax' is
> > the layout name)
>
> > Also read up on RequestHandler, it might help you automate this, maybe
> > overwrite beforeRender in app_controller.
>
> > On Jul 28, 12:16 pm, safl <[EMAIL PROTECTED]> wrote:
>
> > > Hello,
>
> > > I'm struggling with my views. I can't seem to find the proper way to
> > > reuse view code so what i am doing now is a very nasty:
>
> > > <?php require_once(VIEWS .$this->viewPath.'/set_setting.ctp'); ?>
>
> > > I am guessing that this is not the intended way to do It but i can't
> > > seem to figure out how i am supposed to resuse my views.
>
> > > The thing is, I got a the controller action -> "user_settings/
> > > mySettings'. The view "my_settings.ctp", contains several ajax forms,
> > > each with different actions ('setSetting', 'changePassword',
> > > 'setInformation' etc.).
>
> > > These actions need a view to display the form after perform the user
> > > submission of data and reload the form properly afterwards.
> > > So If i don't do the above include of my forms i would be forces to
> > > have the code in both my_settings.ctp and in each individual action
> > > view.
>
> > > Does anybody have a better solution than the above require/include?
>
> > > regards,
> > > Simon


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to