Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9034869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:36:14+00:00 2026-06-16T08:36:14+00:00

I wanted to modify the default list view provided by the Yii framework. The

  • 0

I wanted to modify the default list view provided by the Yii framework. The current view display everything as a row enter image description here. What I want is to display the information in following formatenter image description here. Could you suggest me how can I extend this widget and create my own view. I have attached both needed as a image. I am new to Yii so all help would be really appriciable. If there is already any widget in this format I would be so happy.

Content for my view File would be

    <?php
/* @var $this LeosafealertController */
/* @var $data Leosafealert */
?>

<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('date')); ?>:</b>
    <?php echo CHtml::encode($data->date); ?>
        <br/>
    <b><?php echo CHtml::encode($data->getAttributeLabel('description')); ?>:</b>
    <?php echo CHtml::encode($data->description); ?>
        <br/>
    <b><?php echo CHtml::encode($data->getAttributeLabel('photo')); ?>:</b>
    <?php echo CHtml::image($data->getImageURL().$data->photo,$data->photo); ?>
        </br>
        <b><?php echo CHtml::encode($data->getAttributeLabel('link')); ?>:</b>
    <?php echo CHtml::link(CHtml::encode("click here"), $data->getFileURL().$data->link,array('target'=>'_blank')); ?>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T08:36:16+00:00Added an answer on June 16, 2026 at 8:36 am

    Can you not edit your view file (e.g. just edit ‘/path/to/model/views/_view.php’, or whatever your view file is called)?

    You can also declare your own css file for a CLitView by defining a cssFile property. ie;

    $this->widget('zii.widgets.CListView', array(
        'dataProvider'=>$dataProvider,
        'itemView'=>'_view',
        'cssFile'=>'/css/myCssFile.css',
        ...
    ));
    

    You could create your own css file for your layout and use that for every CListView you want with the given layout?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to modify/customize the android framework. I am a complete newbie in framework
i wanted to try the following code: //all arrays are List<T> type. if (m.terms[0]
I wanted to modify a column in a sql server 2005 table to IDENTITY(1,1)
I wanted to modify the linux kernel code that dynamically changes the process priority.
I'm basically following https://github.com/mattconnolly/devise-custom-strategy-demo/blob/master/lib/my_authentication.rb Everything works well, but there is one bug, if I'm
If I wanted to modify or add my own extensions to C, and add
I have a ModelForm with a FileField, among other fields. I wanted to modify
For testing and learning purpose, I wanted to modify the php rand and mt_rand
I am planning to develop ethernet bootloader. So I wanted to modify the existing
I'm trying to modify a script that someone else has written and I wanted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.