Adding a user is located at /users/add and editing a user is located
at /users/edit/id where id is 1, 2, etc. If I create my form as
follows on /users/edit/1:

<?php echo $form->create('Users'); ?>

The action ends up being /users/edit/1. However, when I submit the
form and the validation says there was an error, the action is changed
to /users/add for the next form submission. Instead of the default
being either add or edit, why can't this function just default to the
current page and use something else when specified? Wouldn't that be
more logical?

Another example of what seems to be improper behavior (or bad logic)
is /users/login. I go to that and it's /users/add. Ok, so let's
specify the url:

<?php echo $form->create('Users', 'login'); ?>

Er, no, that points me to /login, so now I try users/login (thinking
that since I used login with no leading /, I'll end up getting /users/
login). Er, no, I end up with /users/users/login. So finally I find
out that I need to have this:

<?php echo $form->create('Users', '/login'); ?>

Now I finally have the page I want! But then there are those pages
where the action and additional parameters are specified, such as /
users/edit/1. What should I do about that? I can't user $this->here
since the result would be /users/users/edit/1. Do I perform a
completely unnecessary action like using str_replace on the url? Call
me crazy, but I really don't see why the current page isn't used since
most of the time (for me, all of the time) forms are posted to the
page you are accessing. The only time I ever specify a separate page
is when I have a step by step form.

Thanks, loving CakePHP more and more, though I expected the learning
curve to be easier (though it's still not terribly difficult).

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