遇到PHP错误严重性:通知
消息:未定义的变量:角色
文件名:views / sample_list.php
行号:9
<?php if($role[0]['sample']==1){?><a href="<?php echo site_url();?>/welcome/save_sample"><button class="btn btn-add waves-effect waves-light" type="button">Add Sample</button></a><?php }?>
根据条件进行位置检查
<?php if((!empty($role[0]['sample']))&&($role[0]['sample']==1)){?><a href="<?php echo site_url();?>/welcome/save_sample"><button class="btn btn-add waves-effect waves-light" type="button">Add Sample</button></a><?php }?>