However, I get an "htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument" error when after CRUD create option the view action is invoked. For ex. localhost/(my app)/(controller)/view&id=2 gives me the error. Looking at the stack information
-------------------------------------------------------------------------------------------------------------------------
#9
– /Applications/MAMP/htdocs/iow/protected/controllers/ReportController.php(55): CController->renderPartial("view", array("model" => Report))
50 */
51 public function actionView($id)
52 {
53 $this->renderPartial('view',array(
54 'model'=>$this->loadModel($id),
55 ));
56 }
57
58 /**
59 * Creates a new model.
60 * If creation is successful, the browser will be redirected to the 'view' page.
----------------------------------------------------------------------------------------------------------------------------
#10
unknown(0): ReportController->actionView("11")
#11
Screen Shot 2012-08-24 at 2.04.47 PM.png (67.35K)
Number of downloads: 6
My view.php file looks like this
<?php
$this->breadcrumbs=array(
'Reports'=>array('index'),
$model->id,
);
$this->menu=array(
array('label'=>'List Report', 'url'=>array('index')),
array('label'=>'Create Report', 'url'=>array('create')),
array('label'=>'Update Report', 'url'=>array('update', 'id'=>$model->id)),
array('label'=>'Delete Report', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
array('label'=>'Manage Report', 'url'=>array('admin')),
);
?>
<h1>View Report #<?php echo $model->id; ?></h1>
<?php
$this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
'registration',
'vehicle_type',
'violation_type',
'city',
'state',
'description',
'binaryfile',
'filename',
'filetype',
'user',
'create_time',
),
)); ?>
My _view.php file looks like this
<div class="view">
<b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b>
<?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('registration')); ?>:</b>
<?php echo CHtml::encode($data->registration); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('violation_type')); ?>:</b>
<?php echo CHtml::encode($data->violation_type); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('city')); ?>:</b>
<?php echo CHtml::encode($data->city); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('state')); ?>:</b>
<?php echo CHtml::encode($data->state); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('description')); ?>:</b>
<?php echo CHtml::encode($data->description); ?>
<br />
<?php echo CHtml::image(Yii::app()->controller->createUrl('report/loadImage', array('id'=>$this->model->id)));?>
I would be grateful, if some of you can advice how I should go about rendering the image along with form data as we see in the default view action case.

Help













