Class vitalik74\primer\State
Inheritance | vitalik74\primer\State » yii\base\Object |
---|
Provide html-code to state indicators.
Example use in your view:
`
<?php
use vitalik74\primer\State;
?>
= State::open('open', '', ['id' => 'open']) ?>
= State::open('proposed', 'proposed', ['id' => 'proposed']) ?>
= State::open('reopened', 'reopened', ['id' => 'reopened']) ?>
= State::closed('closed', ['id' => 'closed']) ?>
= State::merged('merged', ['id' => 'merged']) ?>
See also http://primercss.io/states/.
Public Methods
Method | Description | Defined By |
---|---|---|
closed() | Synonim of open(). This is syntactic sugar. | vitalik74\primer\State |
merged() | Synonim of open(). This is syntactic sugar. | vitalik74\primer\State |
open() | Return html-code with state indicator | vitalik74\primer\State |
Method Details
Synonim of open(). This is syntactic sugar.
<?php
use vitalik74\primer\State;
?>
<?= State::closed('closed', ['id' => 'closed']) ?>
See also http://primercss.io/states/#closed-red.
string closed( $content, $options = [] ) | ||
$content | string | |
$options | array |
Synonim of open(). This is syntactic sugar.
<?php
use vitalik74\primer\State;
?>
<?= State::merged('merged', ['id' => 'merged']) ?>
string merged( $content, $options = [] ) | ||
$content | string | |
$options | array |
Return html-code with state indicator
<?php
use vitalik74\primer\State;
?>
<?= State::open('open', '', ['id' => 'open']) ?>
See also http://primercss.io/states/#open-green.
string open( $content, $type = 'open', $options = [] ) | ||
$content | string | Content to include in container |
$type | string | Type indicator. Possible type open, closed, merged |
$options | array | Keys-values pair of options use in \yii\helpers\Html::tag() |