I have the code of Search, but its not work correctly. So, please try
to find the problem of the below code..
View Template(search.ctp)
<?php echo $form->create('State',array('action'=>'view',$state['State']
['id']));?>
<fieldset>
<legend><?php __('Search State');?></legend>
<?php
#echo $form->input('id');
echo $form->input('Name');
echo $form->error('name', 'Please Enter State Name',
array('wrap'=>true,'class' => 'error-message'));
echo $form->select('country Name');
echo $form->error('country Name');
#echo $form->input('active');
echo $form->submit('Find');
?>
<ul>
<li><?php echo $html-
>link(__('Search',true),array('action'=>'view',$state['State']
['id']));?> </li>
</ul>
</fieldset>
<?php echo $form->end();?>
Controller Template::
function search($id) {
print('hai');
//$this->redirect(array('action'=>'view',$State['State']['id']));
if(!empty($this->data)) {
$data = $this->State->Country-
>find($id);//'all',array('conditions'=>array('id'=>$this->data['State']
['id'])));
$this->set('res',$data);
$this->redirect(array('controller'=>'State','action'=>'State'));
}
}
Thank you,
Karteek
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment