I created the file and even added the code to the items_controller file (which I learned since not having to do it in regular PHP) but still getting a message that the new page is not found.
http://neighborrow.com/items/create/
The error must be in the items_controller
file because it's working in debug mode, but when I list an item it's showing the confirm message I copied from the items/add page even though I edited it for create:
function create()
{
if(!empty($this->data))
{
if (!empty($this->data))
{
$user_error = false;
$this->Item->create();
if($this->Auth->user())
{
$user_id = $this->Auth->User('id');
}
else
{
if (!$user_id = $this->Item->User->is_user($this->data['Item']['user_email']))
{
$email = $this->data['Item']['user_email'];
// Create Password
$raw_password = $this->PasswordHelper->generatePassword();
// Has Password
$hashed_password = $this->Auth->password($raw_password);
// Add User
if (!$user_id = $this->Item->User->add_basic($email, $hashed_password))
$user_error = true;
// Login the User
$this->Auth->login(array('email' => $email, 'password' => $hashed_password));
// Send Registration Email
$this->Email->send_registration_email($email, $raw_password);
}
}
if(!$user_error)
{
$this->data['Item']['user_id'] = $user_id;
$this->data['Item']['approved'] = 1;
if ($this->Item->save($this->data))
{
$this->Session->setFlash('Congratulations on your first listing! After we review it to make sure it is rentable, we will send you your free profile where you can list, promote, and rent up to nine more items. Feel free to share you new listing right away! <a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>.');
$this->redirect(array('controller' => 'items', 'action' => 'view', $this->Item->id));
}
}
}
}
}