simple search form

Hello everyone thank you in advance for any help ;)

In view/index.php main page file I have to add simple form:




<?php echo CHtml::beginForm();


echo CHtml::textField('text_to_find_ID', ''); 

echo CHtml::submitButton('FIND'); 


echo CHtml::endForm(); ?>



TextField will be full in always the same way - for example: "[color="#8B0000"]ID15:other useless incoming data[/color]"

What I have to do after press FIND by user is:

1. read text field…

2. use preg_split to get ID [color="#808080"](and trim ID letters of course)[/color]


$look_for_id = preg_split('/:/','text_to_find_ID');

$found_id = $look_for_id[0];



  1. jump user to MyModelName/view/found_id

Can anyone help me to build it properly? Please :)

Make a new action for search function…




	public function actionSearchid($look){

//your code goes here

}