Yii Framework Forum: VIEW file CSS not working - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

VIEW file CSS not working Rate Topic: -----

#1 User is offline   Vaibhav 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 55
  • Joined: 23-August 12
  • Location:Berlin

Posted 24 August 2012 - 10:32 AM

This is my basic form which was working perfectly before .... however now after controller/create action the view does not load css. Don't know what the problem is? All I have done different is upload a file and save its path in a database field. Here is how my view looks like. Please note list action is fine. I dont know why the output starts from <h1> tag

Attached File  Screen Shot 2012-08-24 at 5.26.37 PM.png (69.14K)
Number of downloads: 5

My view.php file


<?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

<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('vehicle_type')); ?>:</b>
<?php echo CHtml::encode($data->vehicle_type); ?>
<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 />

<b><?php echo CHtml::encode($data->getAttributeLabel('binaryfile')); ?>:</b>
<?php echo CHtml::encode($data->binaryfile); ?>
<br />

<b><?php echo CHtml::encode($data->getAttributeLabel('filename')); ?>:</b>
<?php echo CHtml::encode($data->filename); ?>
<br />

<b><?php echo CHtml::encode($data->getAttributeLabel('filetype')); ?>:</b>
<?php echo CHtml::encode($data->filetype); ?>
<br />

<b><?php echo CHtml::encode($data->getAttributeLabel('user')); ?>:</b>
<?php echo CHtml::encode($data->user); ?>
<br />

<b><?php echo CHtml::encode($data->getAttributeLabel('create_time')); ?>:</b>
<?php echo CHtml::encode($data->create_time); ?>
<br />

</div>
0

#2 User is offline   bennouna 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,166
  • Joined: 05-January 12
  • Location:Morocco

Posted 24 August 2012 - 10:53 AM

Hello

It seems like you render the view form partially somewhere…

Please post your actionCreate code.

Cheers :)
0

#3 User is offline   Vaibhav 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 55
  • Joined: 23-August 12
  • Location:Berlin

Posted 24 August 2012 - 11:20 AM

Yup, I did. Thanks :-)

View Postbennouna, on 24 August 2012 - 10:53 AM, said:

Hello

It seems like you render the view form partially somewhere…

Please post your actionCreate code.

Cheers :)

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users