How to read field in another view in cakephp 2

佐手、 提交于 2019-12-12 06:18:58

问题


i m in elements/navigation.ctp , in the navbar i put a condition if :

<li class="dropdown"> 

    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
        <i class="fa fa-bell">
            <?php 
            //$this->loadModel("Location");
            if($this->Session->read('auth.Location.status')==0):
            echo '<span class="glyphicon glyphicon-exclamation-sign" style="color:red;">
            </span>';
            ?>

            <?php endif;?>
        </i>
        <b class="caret">
        </b>
    </a>
    <ul class="dropdown-menu alert-dropdown">
        <li>
            <a href="#"><span class="label label-danger">Notificaion</span></a>
        </li>

        <li class="divider"></li>
        <li>
            <a href="#">View All</a>
        </li>
    </ul>
</li>

i went when the field status in Location table is == 0 it displays a notification icon, and when it is 1 it shows nothing, but the problem i think that i have put the false code , Help :'(

来源:https://stackoverflow.com/questions/29060972/how-to-read-field-in-another-view-in-cakephp-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!