xandrkat / yii2-check-ishome
Simple Yii2 component to check isHome no w or not. Or by url.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2025-04-07 16:34:04 UTC
README
Simple Yii2 component to check isHome no w or not. Or by url.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist xandrkat/yii2-check-ishome "@dev"
or add
"xandrkat/yii2-check-ishome": "@dev"
to the require section of your composer.json
file.
Usage
add to main.php backend/frontend/app to copmponents aray
return [ //.... 'components' => [ 'isHome' => [ 'class' => 'xandrkat\homepagecheker\isHome', ], ], ];
Then use any do you want) As Simple, currnet url: Return string 'home' or empty string
<?php var_dump((bool)Yii::$app->isHome) ?> //- 'home'/'' will be returned 'home'/'' ```php <?php use yii\helpers\Url; ?> <?php var_dump((Yii::$app->isHome->check(Url::to('any'))); ?> //- true/false will be returned bool(true/false)