if Yii app user- checkAccess echo form method POST class likeForm echo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
if(Yii::app()->user->checkAccess('1'))
{
echo "<form method='POST' class='likeForm'>";
echo "<button type='submit' class='like' name='idAnswerLiked' value='".$qa->id_answer."'>".'Нравится | '.count($qa->answersLikes)."</button>".' ';
echo "</form>";
}
else
{
echo "<form action='index.php?r=site/login'>";
echo "<input type='submit' class='like' name='idAnswerLiked' value='".'Нравится | '.count($qa->answersLikes)."' onclick='if(confirm(\"Чтобы поставить отметку необходима авторизация\"))submit();else return false;'>";
echo "</form>";
}