-1

I implemented my project in Yii. i done URL management its working fine. but i search URL is not being proper. i added my code here. please tell me how to change this code according to my URL..

my main.php:

<form class="navbar-form " role="search" name="searchform" method="POST" action="<?php  echo Yii::app()->baseUrl.'/index.php/recipe/course1/';?>" id="menu-form-style" onsubmit="return ValidateSearchForm();">
 <div class="form-group">
 <input type="text" name="search" id="search" placeholder="Quick Search...." class="form-control" onkeyup="lookup(this.value);" onblur="fill();">

i sent to my recipe controller.

where i did like this: recipe controller

public function actionCourse1(){

if(isset($_POST["search"]))
$course=$_POST["search"];
$this->redirect(array('recipe/course','searched'=>$course));}

  public function actionCourse(){
    $model=new Recipe;
   if(isset($_GET['searched']))
   $count=$_GET['searched'];
      $bigArray=array(); 

  in  my configure main.php

 'searched'=>'recipe/course',

above config line i wants to be show.

but am getting like this

search/searched/asdfadfadfa

http://kitchenking.ebhasin.com/ this our website. please suggest me suitable answer

Jay kumar
  • 277
  • 2
  • 13

3 Answers3

0

if i understod your question true try this...

$this->render('/recipe/course/ or your file place', array('searched'=>$course));}

or

$this->redirect('/recipe/course/searched/'.$course);
Burhan Çetin
  • 676
  • 7
  • 16
0

Re-read http://www.yiiframework.com/doc/guide/1.1/en/topics.url this one, yes I know that is not an answer, but I think your routes is invalid.

user1954544
  • 1,619
  • 5
  • 26
  • 53
0

change your config main.php:

'search/<searched>'=>'recipe/course',
Jay kumar
  • 277
  • 2
  • 13