Class vitalik74\primer\Blankslate
Inheritance | vitalik74\primer\Blankslate » yii\base\Object |
---|---|
Uses Traits | vitalik74\primer\UtilsTrait |
Class provide simple interface for show container with class blankslate
.
In class use trait \vitalik74\primer\vitalik74\primer\UtilsTrait.
Example use in your view:
<?php
use vitalik74\primer\Blankslate;
?>
<div class="site-blankslate">
<?= Blankslate::blankslate('Text', ['id' => 'blankslate']) ?>
<?= Blankslate::blankslate('Text', ['id' => 'spacious'], 'spacious') ?>
<?= Blankslate::blankslate('Text', ['id' => 'clean'], 'clean') ?>
<?= Blankslate::blankslate('Text', ['id' => 'capped'], 'capped') ?>
<?= Blankslate::blankslate('Text', ['id' => 'fixed'], 'fixed') ?>
<?= Blankslate::blankslate('Text', ['id' => 'no_set'], 'no_set') ?>
<?= Blankslate::blankslateWithOcticons('Text', ['id' => 'blankslateWithOcticons']) ?>
<?= Blankslate::blankslateWithOcticons('Text', ['id' => 'blankslateWithOcticons_commit'], ['commit']) ?>
<?= Blankslate::blankslateWithOcticons('Text', ['id' => 'blankslateWithOcticons_branch'], ['branch']) ?>
<?= Blankslate::blankslateWithOcticons('Text', ['id' => 'blankslateWithOcticons_tag'], ['tag']) ?>
</div>
See also http://primercss.io/blankslate/.
Public Methods
Method | Description | Defined By |
---|---|---|
blankslate() | Return Html-code | vitalik74\primer\Blankslate |
blankslateWithOcticons() | Return Html-code with icons (octicons) | vitalik74\primer\Blankslate |
getType() | If isset $type return value of $types[$type] |
vitalik74\primer\UtilsTrait |
getTypeFromArray() | vitalik74\primer\UtilsTrait |
Method Details
Return Html-code
<?php
use vitalik74\primer\Blankslate;
?>
<?= Blankslate::blankslate('Text', ['id' => 'blankslate']) ?>
<?= Blankslate::blankslate('Text', ['id' => 'spacious'], 'spacious') ?>
<?= Blankslate::blankslate('Text', ['id' => 'clean'], 'clean') ?>
<?= Blankslate::blankslate('Text', ['id' => 'capped'], 'capped') ?>
<?= Blankslate::blankslate('Text', ['id' => 'fixed'], 'fixed') ?>
<?= Blankslate::blankslate('Text', ['id' => 'no_set'], 'no_set') ?>
string blankslate( $content, $options = [], $type = '' ) | ||
$content | string | Content to include in container |
$options | array | Keys-values pair of options use in \yii\helpers\Html::tag() |
$type | string | See vitalik74\primer\Blankslate::_typesBlankslate |
Return Html-code with icons (octicons)
<?php
use vitalik74\primer\Blankslate;
?>
<?= Blankslate::blankslateWithOcticons('Text', ['id' => 'blankslateWithOcticons']) ?>
<?= Blankslate::blankslateWithOcticons('Text', ['id' => 'blankslateWithOcticons_commit'], ['commit']) ?>
<?= Blankslate::blankslateWithOcticons('Text', ['id' => 'blankslateWithOcticons_branch'], ['branch']) ?>
<?= Blankslate::blankslateWithOcticons('Text', ['id' => 'blankslateWithOcticons_tag'], ['tag']) ?>
string blankslateWithOcticons( $content, $options = [], $typesOcticon = [] ) | ||
$content | string | Content to include in container |
$options | array | Keys-values pair of options use in \yii\helpers\Html::tag() |
$typesOcticon | array | Types icons to show. Maybe |