I'm using Yii as a framework and I'm having trouble with this piece of code.
I want to output the apartments which has a "status" of "occupied"
So I have this CHtml link with querystring parameters
<?php echo CHtml::link('Occupied Apartments', array('/apartments/','status'=>'occupied')); ?>
But it still displays ALL outputs even if the status is "available". What must be the problem?
Any help would be appreciated
I think you are trying to construct the link as
For this, First you have configure this URL structure in urlManager in your config file ie, main.php in protected/config/
Just add bellow line in urlManager rules
Finally your basic url rules will appear as
Now your url will work. You can get the status value with
$_GET['status'];