dynamic url link

In my front end ,i have viewed all categories like motorola,samsung,nokia… from category table ,in next page i have viewed corresponding products,i.e.,if i click motorola ,all mobiles of motorola will display from product table.Now my doubt is that,if i click a motorola product,user should view all details of that product(details are in product,design and features table).how it can be acheived dynamically.

Is it not simple.

Just use the product id or the PK of the products table and get all the associated data i.e. features, images etc from the respective tables.

i understand pero !!! not exact !! its simple but am complicating i think…

i have acheived index.php?r=category/ , index.php?r=category/viewproduct&id=1 ,now i have to do index.php?r=category/viewProductdetails&id=1 .

when i display Product names of category id:1 by using for each and add chtml link to product names,

url link shows index.php?r=category/viewproduct&id=1# for all product names?? ,how to change it ? . I have given

product names of category id:1-Nokia as eg: pd_id:1-N72,pd_id:2-N73,pd_id:3-N80

Share your code…


    $por= product::model()->findAllByAttributes(array('cat_id'=>$_GET['cat_id'])); 

    $list = CHtml::listData($por, 



			 foreach($list as $value)


    echo CHtml::link($value,array('showproduct','id'=>$value));  }

the above code,does

when user clicks a product id,the particular product’s details are shown.

i want,user should click product name to show the product’s details !!

You should change it

$list = CHtml::listData($por, 


And then use as

foreach($list as $id=>$name)


    echo CHtml::link($name,array('showproduct','id'=>$id));  }


I have used pd_name for name, please change it with your product’s table for name of product name column.


you taught me a good work today.very thanks.

now am doing, Add to Cart concept.

support till earth exists.