On Apr 7, 4:01 am, Tomatosoup <[email protected]> wrote:
> Hello,
>
> I have a website which I'm working on. I have one part of a page I'd
> like to use more than once, only with different parameters. I've used
> the elements feature of CakePHP. But that becomes too complex, because
> the page I want to reuse has all kinds of references to one controller
> (and I'd like to use it also in another controller).

Use elements with requestAction(). Cache the element. Pass your
parameters to the element.

> Now, I've tried requestAction, but that only imports data from a
> controller action, and not the view.

Consider elements as being mini-views. Once you fetch the data from
the controller you still need to do something with it for display.

> App:import also doesn't seem right, because views still get approached
> by a different controller than the references point to.
>
> So I thought, maybe I should use the 'good old' PHP include
> function :) But that doesn't seem to work, because of mod_rewrite.

It should work if your paths are correct and you use a filesystem
path, rather than a URL. But, it wouldn't solve your problem, anyway.
The controller class wouldn't be properly loaded. That's what
App::import() is for.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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

Reply via email to