In CakePHP 1.3 I have this router in routes.php:
Router::connect('/listing/*', array('controller' => 'items', 'action' => 'index'));
My question is, how can I create an html-form
with submit action to www.mysite.com/listing.json?
This is the form I currently have in the folder app/views/items/index.cpt.
$this->Form->create( 'Item' ); // HTML: <form action="/listing" method="post">
I tried to change the submit-action to "listing.json", but it didn't work because "/items/" is being prepend, and I don't want that.
$this->Form->create( 'Item', array( 'action' => 'listing.json' ) ); // HTML: <form action="/items/listing.json" method="post">
++
In other words, I want the form action to be like this: any idea?
<form action="listing.json" method="post">