nkhanna24 0 Posted January 31, 2013 Report 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? Quote Link to post Share on other sites
Edward 108 Posted January 31, 2013 Report 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 Quote Link to post Share on other sites
nkhanna24 0 Posted January 31, 2013 Author Report Share Posted January 31, 2013 thankss....got it what i was looking for Quote Link to post Share on other sites
Larry 429 Posted February 1, 2013 Report Share Posted February 1, 2013 Thanks, Edward! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.