Does anyone know a way to change the default model used by a page? I
need to try to 'fool' Cake into believing it's running from a
different URL in part of the page.

 My example is for classified listings. On my listings index page,
underneath the main content from the listings controller, I have a
form allowing a user to edit their personal profile at any time - and
should show a pre-filled form, as you'd get by going to
/profiles/edit/4.

I tried using RequestAction in the following but it didn't work as all
that does is return the results of that page, it doesn't change the
"this->..." info being used:

<?
echo $this->model;
// returns "Listing"

$this->data = $this->requestAction('/profiles/edit/4');

echo $this->model;

// still echoes 'Listing', not 'Profile' as hoped.

?>

Can anyone tell me how to achieve this change, as RequestAction
clearly doesn't work. I need to change it so that the form helper
(using the value function in helper.php) will populate, as it takes
its criteria from $this->data[$this->model][$this->field] and if it's
using the wrong model to start with, it's not going to populate the
form correctly.

Thanks.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to