That might work, but I think you'd agree that it's a bit hacky. If
you're working with this URL:

/orders/add/1

Which, following Cake naming conventions, translates to
OrdersController::add() with an id of '1', then all you really need to
do is specify $this->here for the form URL, rather than working with
$this->params['url']['url']. So:

echo $form->create('Order', array('url' => $this->here));

That's the syntax I use for my form URLs, and I never have issues with
disappearing variables, duplicating elements, etc.

- Jamie

On Aug 20, 7:46 am, carl67lp <[email protected]> wrote:
> AD:
>
> That helps quite a bit.  It didn't quite get me there...what I end up
> with is a resulting URL of:
>
> /sitevisits/orders/orders/add/1
>
> Note the duplication of "orders".  With a bit of mucking about, I
> ended up with this:
>
> $parts = explode('/', $this->params['url']['url']);
> $vid = array_pop($parts);
> echo $form->create('Order', array('url' => array('controller' =>
> 'orders', 'action' => 'add', $vid)));
>
> This seems to work perfectly (unless, of course, I'm missing something
> that would lead to unexpected behaviour!).
>
> Thanks for your assistance.
>
> --Carl
--~--~---------~--~----~------------~-------~--~----~
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