The following code generates the desired HTML:
\yii\helpers\Html::a(\yii\helpers\Html::tag('div', \yii\helpers\Html::tag('i', '', ['class' => 'fa fa-upload fa-fw']) . 'Server Rebooted' . \yii\helpers\Html::tag('span', '4 minutes ago', ['class' => 'pull-right text-muted small']) ), \yii\helpers\Url::to('address'));
To get a clearer code:
use yii\helpers\Html; use yii\helpers\Url; Html::a(Html::tag('div', Html::tag('i', '', ['class' => 'fa fa-upload fa-fw']) . 'Server Rebooted' . Html::tag('span', '4 minutes ago', ['class' => 'pull-right text-muted small']) ), Url::to('address'));
Please note that if you want to create a link to a route, use Url::toRoute(['controller/action'])
Ali MasudianPour
source share