How to read field in another view in cakephp 2

2019-08-27 17:35发布

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 :'(

0条回答
登录 后发表回答