cakephp

cakephp structure of source code view


I wonder why this:

<?php
    echo $this->Html->meta('icon');
    echo $this->Html->meta('shortcut icon');
    echo $this->Html->css(array('style', 'backtop'));
    echo $this->Html->script(array('jquery-1.7.min', 'superfish', 'jquery.responsivemenu', 'jquery.flexslider', 'jquery.easing.1.3', 'jquery.ui.totop'));
    echo $this->Html->meta('keywords', 'enter any meta keyword here');
    echo $this->Html->meta('description', 'enter any meta keyword here');
?>

ends up in

<link href="/favicon.ico" type="image/x-icon" rel="icon" /><link href="/favicon.ico" type="image/x-icon" rel="shortcut icon" /><meta/>
<link rel="stylesheet" type="text/css" href="/css/style.css" />
<link rel="stylesheet" type="text/css" href="/css/backtop.css" />

<script type="text/javascript" src="/js/jquery-1.7.min.js"></script>
<script type="text/javascript" src="/js/superfish.js"></script>
<script type="text/javascript" src="/js/jquery.responsivemenu.js"></script>
<script type="text/javascript" src="/js/jquery.flexslider.js"></script>
<script type="text/javascript" src="/js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="/js/jquery.ui.totop.js"></script>

Why are some lines nicely underneath and others in one line? Where does the closing comes from? You'll find it behind the shortcut tag.

I checked other cake sites from cakephp.org and they do not seem to have the same issue as I have.


Solution

  • <?php
        echo $this->Html->meta('icon');
        //echo $this->Html->meta('shortcut icon');
        echo $this->Html->css(array('style', 'backtop'));
        echo $this->Html->script(array('jquery-1.7.min', 'superfish', 'jquery.responsivemenu', 'jquery.flexslider', 'jquery.easing.1.3', 'jquery.ui.totop'));
        echo $this->Html->meta('keywords', 'enter any meta keyword here');
        echo $this->Html->meta('description', 'enter any meta keyword here');
    ?>
    

    do not you echo $this->Html->meta('shortcut icon'); because in cakephp not handling the type "shortcut icon" as meta. that's why it is giving only .

    Following will give you both the meta tags.

    echo $this->Html->meta('icon');
    
    <link href="/cake/caketest/favicon.ico" type="image/x-icon" rel="icon" /><link href="/cake/caketest/favicon.ico" type="image/x-icon" rel="shortcut icon" />