Skip to content
Simplification of HTML helper Yii Framework 2.0
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
CHANGE.md
LICENSE.md
README.md
composer.json

README.md

yii2-simply

This extension is a simplification of HTML helper Yii Framework 2.0.

Html Class

This class extends the Yii Html Helper . The helper functions available in this class are:

  • Html::bebin{anyTag}(['whithot class as key']),
  • Html::end{anyTag}()
  • Html::{anyTag}('content', ['whithot class as key'])

As

<?=\xandrkat\simply\Html::beginDiv(['container']).'any text'.\xandrkat\simply\Html::endDiv()?>
// result <div class="container">any text</div>
<?=\xandrkat\simply\Html::beginDiv(['class' => 'container']).'any text'.\xandrkat\simply\Html::endDiv()?>
// result <div class="container">any text</div> 
<?=\xandrkat\simply\Html::beginDiv(['container', 'class' => 'bg-primary']).'any text'.\xandrkat\simply\Html::endDiv()?>
// result <div class="container bg-primary">any text</div> 
// or simple tag
<?=\xandrkat\simply\Html::p('any content', ['text-center'])?>
// result <p class="text-center">any content</p>
<?=\xandrkat\simply\Html::p('any content', ['class' => 'text-center'])?>
// result <p class="text-center">any content</p>
<?=\xandrkat\simply\Html::p('any content', ['text-success', 'class' => 'text-center'])?>
// result <p class="text-success text-center">any content</p>

Or

use xandrkat\simply;

<?=Html::beginDiv(['container']).'any text'.Html::endDiv()?>
// result <div class="container">any text</div>
<?=Html::beginDiv(['class' => 'container']).'any text'.Html::endDiv()?>
// result <div class="container">any text</div> 
<?=Html::beginDiv(['container', 'class' => 'bg-primary']).'any text'.Html::endDiv()?>
// result <div class="container bg-primary">any text</div> 
// or simple tag
<?=Html::p('any content', ['text-center'])?>
// result <p class="text-center">any content</p>
<?=Html::p('any content', ['class' => 'text-center'])?>
// result <p class="text-center">any content</p>
<?=Html::p('any content', ['text-success', 'class' => 'text-center'])?>
// result <p class="text-success text-center">any content</p>

Attention

Html::a(), Html::img() etc. inherits yii\helpers\Html

License

yii2-helpers-simplyHtml is released under the BSD-3-Clause License. See the bundled LICENSE.md for details.

You can’t perform that action at this time.