santos_mgr
santos_mgr

Reputation: 37

making a link unclickable in yii

how to make a link in yii unclickable? I have some id problems i.e. In the second form which is "Primary complain chain", there is a value which is used from the userinput data value in first form which is "Name and reference". So, if some one breaks the pipeline and moves directly to Primary complain chain, then, non-object error occurs which I want to avoid. So, I was thinking if there is any trick such that, the links could be not click-able.

Please, I am stuck on this for like a long hour. Help needed immediately.

<?php
$this->menu = array(
    array('icon'=>'plus-sign-alt','label'=>'Home', 'url'=>array('/cname/index')),
    array('icon'=>'plus-sign-alt','label'=>'Name & Reference', 'url'=>array('/cname/create'),'active'=>true,),
    array('icon'=>'icon-signal','label'=>'Primary complain chain', 'url'=>array('/cprimary/create')),
); 
?>

<?php 
echo $this->renderPartial('_form', array('model'=>$model, 'model1'=>$model1)); 
?>

enter image description here

Upvotes: 0

Views: 95

Answers (1)

Samuel Liew
Samuel Liew

Reputation: 79113

You could remove the menu item using something like this:

array('icon'=>'icon-signal',
      'label'=>'Primary complain chain', 
      'url'=>array('/cprimary/create'),
      'visible'=>isset($model->name) && isset($model->reference),
),

Upvotes: 2

Related Questions