When I post the form it shows error:
Trying to get property of non-object [APP\Controller\UsersController.php, line 647].
Here the ctp file form code:
admin_highlightedstylist.ctp is
<?php echo $this->Form->create('Userhighlighted'); ?>
<tr>
<th>STYLIST LIST</th>
<th><?php echo $this->Form->input('stylist_id', array('empty' => 'Select Stylist')); ?></th>
<th>
<div class="submit">
<?php echo $this->Form->end('ADD HIGHLIGHTED'); ?>
</div>
</th>
</tr>
Here the controller code script, UserController.php
public function admin_highlightedstylist(){
$this->layout = 'admin';
$this->isAdmin();
if($this->request->is('post')){
print_r($this->requert->data['Userhighlighted']['stylist_id']);
exit;
}
$stylists = $this->User->find('list', array('conditions'=>array('is_stylist' => true,)));
$this->set(compact('id', 'stylists'));
}
How can I remove this error and how can I solve it?