I’m not sure how to identify the issue I’m having, so please forgive the generic topic title. (newbie)
I have a class for location and a class for invoice, I’m displaying all the invoices for a specific location on a location view. When I click on the link for the invoice I get an Error 404 The requested page does not exist. The problem is the the routing in the browser shows: //localhost/weaccount/index.php?r=location/view&id=4 it should show: //localhost/weaccount/index.php?r=invheader/view&id=4. Since I’m not sure how to lable this issue I can’t search and find others who have had the problem to figure out the fix. The initial page shows the location and then a listview from invheader, its when I click on one of the items int he listview from invheader that I get the 404 error.
See attached screen shot.
The code in LocationController.php:
public function actionView($id)
{
$invheaderDataProvider=new CActiveDataProvider('Invheader',
array('criteria'=>array(
'condition'=>'tbl_location_locationId=:locationId',
'params'=>array(':locationId'=>$this->loadModel($id)->locationId),
),
'pagination'=>array('pageSize'=>1,
),
)
);
$this->render('view', array(
'model'=>$this->loadModel($id),
'invheaderDataProvider'=>$invheaderDataProvider,
));
}
The code is /location/view.php
<h1>View Location #<?php echo $model->locationId; ?></h1>
<?php $this->widget(‘zii.widgets.CDetailView’, array(
'data'=>$model,
'attributes'=>array(
'locationId',
'locationName',
'locationDistrict',
'qbClass',
),
)); ?>
<br />
<h1>Invoices</h1>
<?php $this->widget(‘zii.widgets.CListView’, array(
'dataProvider'=>$invheaderDataProvider,
'itemView'=>'/invheader/_view',
)); ?>