U
U
usja2011-12-13 14:15:55
Zend Framework
usja, 2011-12-13 14:15:55

How to display formatted html in Zend Framework?

All templates and outputs are neatly formatted, but when viewing the source of the html page, the code is absolutely unreadable. Formatting occurs according to the "taboo" and with the help of NetBeans.
Where to dig and how to solve the problem?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vladislav Shchekoldin, 2011-12-13
@ZiNTeR

In addition to the template, this can be done at the Front_Controller plugin level - approximately at the postDispatch level. Dig Bootstrap
Also, compression can be at the server level - see installed modules.
In general, it's better to use Firebug (under Firefox) or Developer Tools (under Google Chrome) - it's more convenient.

S
sdevalex, 2011-12-13
@sdevalex

Do you keep in mind that ?> eats \n after itself?

<div class="block">
     <?php echo $block; ?>
</div><!-- Эта строчка сольется с предыдущей... -->

Write like this and everything will be beautiful ...
<div class="block">
     <?php echo $block; ?>

</div>

U
usja, 2011-12-13
@usja

I take it into account, but the code is not even the same as in the example.
There can be a lot of carriage returns between the text, although the cycle is neatly written.

U
usja, 2011-12-13
@usja

Example:
layout.phtml

        <?php echo $this->headTitle(); ?>
        <?php echo $this->headMeta(); ?>
        <?php
        $this->headLink()->appendStylesheet('/css/reset_style.css');
        $this->headLink()->appendStylesheet('/css/style.css');
        ?>

        <?php
        $this->headScript()->appendFile('/js/jquery.js');
        ?>


        <?php echo $this->magicHeadLink(); ?>
        
        <?php echo $this->magicHeadScript(); ?>

At the exit:
      <title>Товары</title>        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="keywords" content="Товары" />
<meta name="description" content="Товары" />        
        

        <link href="cache/css/4c076c66d6f959e64839691c59d1f549_uds.css" media="screen" rel="stylesheet" type="text/css" />        
        <script type="text/javascript" src="cache/js/3bfaccafaad5ffb915b381bc32527b76_uds.js"></script>  

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question