nkhanna24 Posted January 31, 2013 Share Posted January 31, 2013 hi allI am having this difficulty with this button <div class="row buttons"><?= CHtml::submitButton('Submit to all', array('class' => 'button-send-v2', 'value' => '','name'=>'all')); ?><span class="go-back"><span class="gray-text"> or </span><?= CHtml::link('Cancel', $this->createAbsoluteUrl('forum/index'), array('class' => 'go-back')); ?></span></div>how do i hide this button depending on the user id(Yii::app()->user->id) or at admin login? Link to comment Share on other sites More sharing options...
Edward Posted January 31, 2013 Share Posted January 31, 2013 Well it depends on what the id of admin is, if admin had an id of 1 then something like this <div class="row buttons"> <?php if (Yii::app()->user->id !== 1) { // Render the button if admin is not logged in with user id 1 CHtml::submitButton('Submit to all', array('class' => 'button-send-v2', 'value' => '','name'=>'all')); } ?> <span class="go-back"><span class="gray-text"> or </span><?= CHtml::link('Cancel', $this->createAbsoluteUrl('forum/index'), array('class' => 'go-back')); ?></span></div> 1 Link to comment Share on other sites More sharing options...
nkhanna24 Posted January 31, 2013 Author Share Posted January 31, 2013 thankss....got it what i was looking for Link to comment Share on other sites More sharing options...
Larry Posted February 1, 2013 Share Posted February 1, 2013 Thanks, Edward! Link to comment Share on other sites More sharing options...
Recommended Posts