Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating new pages in CakePHP
    primarykey
    data
    text
    <p>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.</p> <p><a href="http://neighborrow.com/items/create/" rel="nofollow noreferrer">http://neighborrow.com/items/create/</a></p> <p>The error must be in the <code>items_controller</code> 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:</p> <pre><code> function create() { if(!empty($this-&gt;data)) { if (!empty($this-&gt;data)) { $user_error = false; $this-&gt;Item-&gt;create(); if($this-&gt;Auth-&gt;user()) { $user_id = $this-&gt;Auth-&gt;User('id'); } else { if (!$user_id = $this-&gt;Item-&gt;User-&gt;is_user($this-&gt;data['Item']['user_email'])) { $email = $this-&gt;data['Item']['user_email']; // Create Password $raw_password = $this-&gt;PasswordHelper-&gt;generatePassword(); // Has Password $hashed_password = $this-&gt;Auth-&gt;password($raw_password); // Add User if (!$user_id = $this-&gt;Item-&gt;User-&gt;add_basic($email, $hashed_password)) $user_error = true; // Login the User $this-&gt;Auth-&gt;login(array('email' =&gt; $email, 'password' =&gt; $hashed_password)); // Send Registration Email $this-&gt;Email-&gt;send_registration_email($email, $raw_password); } } if(!$user_error) { $this-&gt;data['Item']['user_id'] = $user_id; $this-&gt;data['Item']['approved'] = 1; if ($this-&gt;Item-&gt;save($this-&gt;data)) { $this-&gt;Session-&gt;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! &lt;a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php"&gt;Share&lt;/a&gt;&lt;script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"&gt;&lt;/script&gt;.'); $this-&gt;redirect(array('controller' =&gt; 'items', 'action' =&gt; 'view', $this-&gt;Item-&gt;id)); } } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload