Commit c94a40e9 by Carsten Brandt

added a large amount of missing documentation

parent 79457ce6
......@@ -72,6 +72,7 @@ class Choice extends Widget
public $clientIdGetParamName = 'authclient';
/**
* @var array the HTML attributes that should be rendered in the div HTML tag representing the container element.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [
'class' => 'auth-clients'
......
......@@ -39,6 +39,7 @@ class ButtonDropdown extends Widget
public $label = 'Button';
/**
* @var array the HTML attributes of the button.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [];
/**
......
......@@ -42,13 +42,17 @@ class NavBar extends Widget
/**
* @var array the HTML attributes for the widget container tag. The following special options are recognized:
*
* - tag: string, defaults to "nav", the name of the container tag
* - tag: string, defaults to "nav", the name of the container tag.
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [];
/**
* @var array the HTML attributes for the container tag. The following special options are recognized:
*
* - tag: string, defaults to "div", the name of the container tag
* - tag: string, defaults to "div", the name of the container tag.
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $containerOptions = [];
/**
......@@ -63,6 +67,7 @@ class NavBar extends Widget
public $brandUrl;
/**
* @var array the HTML attributes of the brand link.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $brandOptions = [];
/**
......@@ -76,6 +81,7 @@ class NavBar extends Widget
public $renderInnerContainer = true;
/**
* @var array the HTML attributes of the inner container.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $innerContainerOptions = [];
......
......@@ -60,7 +60,7 @@ use yii\helpers\Html;
class Progress extends Widget
{
/**
* @var string the button label
* @var string the button label.
*/
public $label;
/**
......@@ -68,7 +68,8 @@ class Progress extends Widget
*/
public $percent = 0;
/**
* @var array the HTML attributes of the bar
* @var array the HTML attributes of the bar.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $barOptions = [];
/**
......@@ -84,6 +85,7 @@ class Progress extends Widget
* // optional, array, additional HTML attributes for the bar tag
* 'options' => [],
* ]
* ```
*/
public $bars;
......
......@@ -75,16 +75,20 @@ class Tabs extends Widget
* by the "options" set in individual [[items]]. The following special options are recognized:
*
* - tag: string, defaults to "div", the tag name of the item container tags.
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $itemOptions = [];
/**
* @var array list of HTML attributes for the header container tags. This will be overwritten
* by the "headerOptions" set in individual [[items]].
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $headerOptions = [];
/**
* @var array list of HTML attributes for the tab header link tags. This will be overwritten
* by the "linkOptions" set in individual [[items]].
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $linkOptions = [];
/**
......
......@@ -21,6 +21,7 @@ class Widget extends \yii\base\Widget
{
/**
* @var array the HTML attributes for the widget container tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [];
/**
......
......@@ -47,6 +47,8 @@ class Accordion extends Widget
* @var array the HTML attributes for the widget container tag. The following special options are recognized:
*
* - tag: string, defaults to "div", the tag name of the container tag of this widget
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [];
/**
......@@ -69,6 +71,8 @@ class Accordion extends Widget
* by the "options" set in individual [[items]]. The following special options are recognized:
*
* - tag: string, defaults to "div", the tag name of the item container tags.
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $itemOptions = [];
/**
......@@ -76,6 +80,8 @@ class Accordion extends Widget
* by the "headerOptions" set in individual [[items]]. The following special options are recognized:
*
* - tag: string, defaults to "h3", the tag name of the item container tags.
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $headerOptions = [];
......
......@@ -56,6 +56,7 @@ class DatePicker extends InputWidget
public $inline = false;
/**
* @var array the HTML attributes for the container tag. This is only used when [[inline]] is true.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $containerOptions = [];
......
......@@ -51,7 +51,9 @@ class Selectable extends Widget
/**
* @var array the HTML attributes for the widget container tag. The following special options are recognized:
*
* - tag: string, defaults to "ul", the tag name of the container tag of this widget
* - tag: string, defaults to "ul", the tag name of the container tag of this widget.
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [];
/**
......@@ -72,6 +74,8 @@ class Selectable extends Widget
* by the "options" set in individual [[items]]. The following special options are recognized:
*
* - tag: string, defaults to "li", the tag name of the item container tags.
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $itemOptions = [];
......
......@@ -55,6 +55,7 @@ class SliderInput extends InputWidget
];
/**
* @var array the HTML attributes for the container tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $containerOptions = [];
......
......@@ -41,7 +41,9 @@ class Sortable extends Widget
/**
* @var array the HTML attributes for the widget container tag. The following special options are recognized:
*
* - tag: string, defaults to "ul", the tag name of the container tag of this widget
* - tag: string, defaults to "ul", the tag name of the container tag of this widget.
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [];
/**
......@@ -62,6 +64,8 @@ class Sortable extends Widget
* by the "options" set in individual [[items]]. The following special options are recognized:
*
* - tag: string, defaults to "li", the tag name of the item container tags.
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $itemOptions = [];
......
......@@ -56,7 +56,9 @@ class Tabs extends Widget
/**
* @var array the HTML attributes for the widget container tag. The following special options are recognized:
*
* - tag: string, defaults to "div", the tag name of the container tag of this widget
* - tag: string, defaults to "div", the tag name of the container tag of this widget.
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [];
/**
......@@ -77,11 +79,14 @@ class Tabs extends Widget
* by the "options" set in individual [[items]]. The following special options are recognized:
*
* - tag: string, defaults to "div", the tag name of the item container tags.
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $itemOptions = [];
/**
* @var array list of HTML attributes for the header container tags. This will be overwritten
* by the "headerOptions" set in individual [[items]].
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $headerOptions = [];
/**
......
......@@ -24,6 +24,7 @@ class Widget extends \yii\base\Widget
public static $theme = 'yii\jui\ThemeAsset';
/**
* @var array the HTML attributes for the widget container tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [];
/**
......
......@@ -41,6 +41,7 @@ class Captcha extends InputWidget
public $captchaAction = 'site/captcha';
/**
* @var array HTML attributes to be applied to the CAPTCHA image tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $imageOptions = [];
/**
......@@ -51,9 +52,11 @@ class Captcha extends InputWidget
public $template = '{image} {input}';
/**
* @var array the HTML attributes for the input tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = ['class' => 'form-control'];
/**
* Initializes the widget.
*/
......
......@@ -39,11 +39,25 @@ use yii\helpers\Html;
*/
class CheckboxColumn extends Column
{
/**
* @var string the name of the input checkbox input fields. This will be appended with `[]` to ensure it is an array.
*/
public $name = 'selection';
/**
* @var array HTML attributes for the checkboxes.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $checkboxOptions = [];
/**
* @var bool whether it is possible to select multiple rows. Defaults to `true`.
*/
public $multiple = true;
/**
* @inheritdoc
* @throws \yii\base\InvalidConfigException if [[name]] is not set.
*/
public function init()
{
parent::init();
......
......@@ -39,15 +39,33 @@ class Column extends Object
* @var boolean whether this column is visible. Defaults to true.
*/
public $visible = true;
/**
* @var array the HTML attributes for the column group tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [];
/**
* @var array the HTML attributes for the header cell tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $headerOptions = [];
/**
* @var array|\Closure
* @var array|\Closure the HTML attributes for the data cell tag. This can either be an array of
* attributes or an anonymous function that ([[Closure]]) that returns such an array.
* The signature of the function should be the following: `function ($model, $key, $index, $gridView)`.
* A function may be used to assign different attributes to different rows based on the data in that row.
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $contentOptions = [];
/**
* @var array the HTML attributes for the footer cell tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $footerOptions = [];
/**
* @var array the HTML attributes for the filter cell tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $filterOptions = [];
......
......@@ -62,6 +62,7 @@ class DataColumn extends Column
/**
* @var array the HTML attributes for the link tag in the header cell
* generated by [[\yii\data\Sort::link]] when sorting is enabled for this column.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $sortLinkOptions = [];
/**
......@@ -78,10 +79,14 @@ class DataColumn extends Column
* @var array the HTML attributes for the filter input fields. This property is used in combination with
* the [[filter]] property. When [[filter]] is not set or is an array, this property will be used to
* render the HTML attributes for the generated filter input fields.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $filterInputOptions = ['class' => 'form-control', 'id' => null];
/**
* @inheritdoc
*/
protected function renderHeaderCellContent()
{
if ($this->header !== null || $this->label === null && $this->attribute === null) {
......@@ -117,6 +122,9 @@ class DataColumn extends Column
}
}
/**
* @inheritdoc
*/
protected function renderFilterCellContent()
{
if (is_string($this->filter)) {
......
......@@ -41,25 +41,30 @@ class GridView extends BaseListView
*/
public $caption;
/**
* @var array the HTML attributes for the caption element
* @var array the HTML attributes for the caption element.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
* @see caption
*/
public $captionOptions = [];
/**
* @var array the HTML attributes for the grid table element
* @var array the HTML attributes for the grid table element.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $tableOptions = ['class' => 'table table-striped table-bordered'];
/**
* @var array the HTML attributes for the container tag of the grid view.
* The "tag" element specifies the tag name of the container element and defaults to "div".
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = ['class' => 'grid-view'];
/**
* @var array the HTML attributes for the table header row
* @var array the HTML attributes for the table header row.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $headerRowOptions = [];
/**
* @var array the HTML attributes for the table footer row
* @var array the HTML attributes for the table footer row.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $footerRowOptions = [];
/**
......@@ -76,6 +81,8 @@ class GridView extends BaseListView
* - `$key`: the key value associated with the current data model
* - `$index`: the zero-based index of the data model in the model array returned by [[dataProvider]]
* - `$grid`: the GridView object
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $rowOptions = [];
/**
......@@ -162,10 +169,12 @@ class GridView extends BaseListView
*/
public $filterPosition = self::FILTER_POS_BODY;
/**
* @var array the HTML attributes for the filter row element
* @var array the HTML attributes for the filter row element.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $filterRowOptions = ['class' => 'filters'];
/**
* Initializes the grid view.
* This method will initialize required property values and instantiate [[columns]] objects.
......@@ -204,7 +213,6 @@ class GridView extends BaseListView
parent::run();
}
/**
* Returns the options for the grid view JS widget.
* @return array the options
......@@ -239,6 +247,10 @@ class GridView extends BaseListView
return Html::tag('table', implode("\n", $content), $this->tableOptions);
}
/**
* Renders the caption element.
* @return bool|string the rendered caption element or `false` if no caption element should be rendered.
*/
public function renderCaption()
{
if (!empty($this->caption)) {
......@@ -248,6 +260,10 @@ class GridView extends BaseListView
}
}
/**
* Renders the column group HTML.
* @return bool|string the column group HTML or `false` if no column group should be rendered.
*/
public function renderColumnGroup()
{
$requireColumnGroup = false;
......@@ -271,7 +287,7 @@ class GridView extends BaseListView
/**
* Renders the table header.
* @return string the rendering result
* @return string the rendering result.
*/
public function renderTableHeader()
{
......@@ -292,7 +308,7 @@ class GridView extends BaseListView
/**
* Renders the table footer.
* @return string the rendering result
* @return string the rendering result.
*/
public function renderTableFooter()
{
......@@ -310,6 +326,7 @@ class GridView extends BaseListView
/**
* Renders the filter.
* @return string the rendering result.
*/
public function renderFilters()
{
......@@ -327,7 +344,7 @@ class GridView extends BaseListView
/**
* Renders the table body.
* @return string the rendering result
* @return string the rendering result.
*/
public function renderTableBody()
{
......@@ -429,6 +446,10 @@ class GridView extends BaseListView
]);
}
/**
* This function tries to guesses the columns to show from the given data
* if [[columns]] are not explicitly specified.
*/
protected function guessColumns()
{
$models = $this->dataProvider->getModels();
......
......@@ -40,6 +40,8 @@ class ActiveField extends Component
* The following special options are recognized:
*
* - tag: the tag name of the container element. Defaults to "div".
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = ['class' => 'form-group'];
/**
......@@ -50,6 +52,7 @@ class ActiveField extends Component
/**
* @var array the default options for the input tags. The parameter passed to individual input methods
* (e.g. [[textInput()]]) will be merged with this property when rendering the input tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $inputOptions = ['class' => 'form-control'];
/**
......@@ -58,11 +61,14 @@ class ActiveField extends Component
* The following special options are recognized:
*
* - tag: the tag name of the container element. Defaults to "div".
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $errorOptions = ['class' => 'help-block'];
/**
* @var array the default options for the label tags. The parameter passed to [[label()]] will be
* merged with this property when rendering the label tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $labelOptions = ['class' => 'control-label'];
/**
......@@ -71,6 +77,8 @@ class ActiveField extends Component
* The following special options are recognized:
*
* - tag: the tag name of the container element. Defaults to "div".
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $hintOptions = ['class' => 'hint-block'];
/**
......
......@@ -34,8 +34,7 @@ class ActiveForm extends Widget
public $method = 'post';
/**
* @var array the HTML attributes (name-value pairs) for the form tag.
* The values will be HTML-encoded using [[\yii\helpers\Html::encode()]].
* If a value is null, the corresponding attribute will not be rendered.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [];
/**
......
......@@ -22,6 +22,7 @@ abstract class BaseListView extends Widget
/**
* @var array the HTML attributes for the container tag of the list view.
* The "tag" element specifies the tag name of the container element and defaults to "div".
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [];
/**
......
......@@ -53,6 +53,7 @@ class Breadcrumbs extends Widget
public $tag = 'ul';
/**
* @var array the HTML attributes for the breadcrumb container tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = ['class' => 'breadcrumb'];
/**
......
......@@ -91,6 +91,7 @@ class DetailView extends Widget
/**
* @var array the HTML attributes for the container tag of this widget. The "tag" option specifies
* what container tag should be used. It defaults to "table" if not set.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = ['class' => 'table table-striped table-bordered detail-view'];
/**
......@@ -100,6 +101,7 @@ class DetailView extends Widget
*/
public $formatter;
/**
* Initializes the detail view.
* This method will initialize required property values.
......
......@@ -43,6 +43,7 @@ class InputWidget extends Widget
public $value;
/**
* @var array the HTML attributes for the input tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [];
......
......@@ -35,10 +35,12 @@ class LinkPager extends Widget
public $pagination;
/**
* @var array HTML attributes for the pager container tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = ['class' => 'pagination'];
/**
* @var array HTML attributes for the link in a pager container tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $linkOptions = [];
/**
......
......@@ -34,7 +34,8 @@ class LinkSorter extends Widget
public $attributes;
/**
* @var array HTML attributes for the sorter container tag.
* See [[\yii\helpers\Html::ul()]] for special attributes.
* @see \yii\helpers\Html::ul() for special attributes.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = ['class' => 'sorter'];
......
......@@ -22,6 +22,7 @@ class ListView extends BaseListView
* @var array the HTML attributes for the container of the rendering result of each data model.
* The "tag" element specifies the tag name of the container element and defaults to "div".
* If "tag" is false, it means no container element will be rendered.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $itemOptions = [];
/**
......@@ -55,6 +56,7 @@ class ListView extends BaseListView
/**
* @var array the HTML attributes for the container tag of the list view.
* The "tag" element specifies the tag name of the container element and defaults to "div".
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = ['class' => 'list-view'];
......
......@@ -63,6 +63,7 @@ class MaskedInput extends InputWidget
public $completed;
/**
* @var array the HTML attributes for the input tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = ['class' => 'form-control'];
......
......@@ -74,6 +74,8 @@ class Menu extends Widget
* by the "options" set in individual [[items]]. The following special options are recognized:
*
* - tag: string, defaults to "li", the tag name of the item container tags.
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $itemOptions = [];
/**
......@@ -122,6 +124,8 @@ class Menu extends Widget
* @var array the HTML attributes for the menu's container tag. The following special options are recognized:
*
* - tag: string, defaults to "ul", the tag name of the item container tags.
*
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [];
/**
......
......@@ -45,6 +45,7 @@ class Pjax extends Widget
{
/**
* @var array the HTML attributes for the widget container tag.
* See [[\yii\helpers\Html::renderTagAttributes()]] for details on how attributes are being rendered.
*/
public $options = [];
/**
......@@ -79,7 +80,7 @@ class Pjax extends Widget
*/
public $scrollTo = false;
/**
* @var array additional options to be passed to the pjax JS plugin. Please refer to
* @var array additional options to be passed to the pjax JS plugin. Please refer to the
* [pjax project page](https://github.com/yiisoft/jquery-pjax) for available options.
*/
public $clientOptions;
......
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