Skip to content
Handy library to generate HTML
PHP
Branch: master
Clone or download
Latest commit 5abe87d Aug 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Initial commit Jul 23, 2019
src Fix formatting Aug 12, 2019
tests Cleanup Aug 12, 2019
.gitattributes Initial commit Jul 23, 2019
.gitignore Initial commit Jul 23, 2019
.scrutinizer.yml Initial commit Jul 23, 2019
.styleci.yml Initial commit Jul 23, 2019
.travis.yml Initial commit Jul 23, 2019
CHANGELOG.md Initial commit Jul 23, 2019
LICENSE.md Initial commit Jul 23, 2019
README.md
composer.json Cleanup Aug 12, 2019
phpunit.xml.dist Initial commit Jul 23, 2019

README.md

Yii HTML


The package ...

Latest Stable Version Total Downloads Build Status Scrutinizer Code Quality Code Coverage

REQUIREMENTS:

  • The minimum requirement by this project template that your Web server supports:
    • PHP 7.2 or higher.

INSTALLATION:

If you do not have Composer, you may install it by following the instructions at getcomposer.org.

You can then install this project template using the following command:

composer require yiisoft/html

General usage

use Yiisoft\Html\Html;

<?= Html::tag('meta', '', ['http-equiv' => 'X-UA-Compatible', 'content' => 'IE=edge']) ?>
<?= Html::tag('meta', '', ['name' => 'viewport', 'content' => 'width=device-width, initial-scale=1']) ?>

<?= Html::cssFile($aliases->get('@css/site.css'), ['rel' => 'stylesheet']); ?>

<?= Html::cssFile(
    'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css',
    [
        'rel' => 'stylesheet',
        'integrity' => 'sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T',
        'crossorigin' => 'anonymous'
    ]
); ?>

<?= Html::beginTag('footer', ['class' => 'footer']) ?>
    <?= Html::beginTag('div', ['class' => 'container flex-fill']) ?>
        <?= Html::beginTag('p', ['class' => 'float-left']) ?>
        <?= Html::endTag('p') ?>
        <?= Html::beginTag('p', ['class' => 'float-right']) ?>
            <?= 'Powered by' ?>
            <?= Html::a(
                'Yii Framework',
                'http://www.yiiframework.com/',
                ['rel' => 'external']
            ) ?>
        <?= Html::endTag('p') ?>
    <?= Html::endTag('div') ?>
<?= Html::endTag('footer') ?>
You can’t perform that action at this time.