Commit 95b58207 by Crisu83

Adds a BootDetailView example to the demo.

parent 130dd139
...@@ -317,7 +317,20 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -317,7 +317,20 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h2>BootDetailView</h2> <h2>BootDetailView</h2>
<p>@todo</p> <?php $this->widget('bootstrap.widgets.BootDetailView', array(
'data'=>array('id'=>1, 'firstName'=>'Mark', 'lastName'=>'Otto', 'language'=>'CSS'),
'attributes'=>array('firstName', 'lastName', 'language'),
)); ?>
<h4>Source code</h4>
<?php echo $parser->safeTransform("~~~
[php]
<?php \$this->widget('bootstrap.widgets.BootDetailView', array(
'data'=>array('id'=>1, 'firstName'=>'Mark', 'lastName'=>'Otto', 'language'=>'CSS'),
'attributes'=>array('firstName', 'lastName', 'language'),
)); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
......
...@@ -16,6 +16,14 @@ Yii::import('zii.widgets.CDetailView'); ...@@ -16,6 +16,14 @@ Yii::import('zii.widgets.CDetailView');
class BootDetailView extends CDetailView class BootDetailView extends CDetailView
{ {
/** /**
* @var string the template used to render a single attribute. Defaults to a table row.
*/
public $itemTemplate="<tr class=\"{class}\"><th style=\"width: 160px\">{label}</th><td>{value}</td></tr>\n";
/**
* @var array the CSS class names for the items displaying attribute values.
*/
public $itemCssClass = array();
/**
* @var array the HTML attributes for the container. * @var array the HTML attributes for the container.
*/ */
public $htmlOptions = array('class'=>'table table-striped table-condensed detail-view'); public $htmlOptions = array('class'=>'table table-striped table-condensed detail-view');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment