yii\widgets\DetailView::run PHP Method

run() public method

This is the main entry of the whole detail view rendering.
public run ( )
    public function run()
    {
        $rows = [];
        $i = 0;
        foreach ($this->attributes as $attribute) {
            $rows[] = $this->renderAttribute($attribute, $i++);
        }
        $options = $this->options;
        $tag = ArrayHelper::remove($options, 'tag', 'table');
        echo Html::tag($tag, implode("\n", $rows), $options);
    }

Usage Example

Example #1
0
 public function run()
 {
     echo '<div class="panel panel-default panel-view">';
     if ($this->title) {
         echo '<div class="panel-heading">' . $this->title . '</div>';
     }
     echo '<div class="panel-body">';
     parent::run();
     echo '</div>';
     if ($this->footer) {
         echo '<div class="panel-footer">' . $this->footer . '</div>';
     }
     echo '</div>';
 }