🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #230999

Re: czym kierują się ludzie piszący każdą linie kodu PHP w osobnych znacznikach <?php ?>

#230999
From: Minu
Date: Fri, 19 Jun 2015 22:29
64 lines
3336 bytes
W dniu 19.06.2015 o 19:29, Kviat pisze:
> Nie spotkałem się z czymś takim. Gdzie to widziałeś?


Przykładowo jeden z najpopularniejszych motywów do WordPressa
https://downloads.wordpress.org/theme/zerif-lite.1.8.2.1.zip

Plik zerif-lite/front-page.php:

<div class="content-left-wrap col-md-9">
    <div id="primary" class="content-area">
        <main id="main" class="site-main" role="main">
        <?php if ( have_posts() ) : ?>
            <?php /* Start the Loop */ ?>
            <?php while ( have_posts() ) : the_post(); ?>
                <?php
                    /* Include the Post-Format-specific template for the
content.
                     * If you want to override this in a child theme,
then include a file
                     * called content-___.php (where ___ is the Post
Format name) and that will be used instead.
                     */
                    get_template_part( 'content', get_post_format() );
                ?>
            <?php endwhile; ?>
            <?php zerif_paging_nav(); ?>
        <?php else : ?>
                <?php get_template_part( 'content', 'none' ); ?>
        <?php endif; ?>
        </main><!-- #main -->
    </div><!-- #primary -->
</div><!-- .content-left-wrap -->

Powyższe jest czytelniejsze niż kod poniżej?

<div class="content-left-wrap col-md-9">
    <div id="primary" class="content-area">
        <main id="main" class="site-main" role="main">
            <?php
            if (have_posts()) :
                /* Start the Loop */
                while (have_posts()) : the_post();

                    /* Include the Post-Format-specific template for the
content.
                     * If you want to override this in a child theme,
then include a file
                     * called content-___.php (where ___ is the Post
Format name) and that will be used instead.
                     */
                    get_template_part('content', get_post_format());
                endwhile;
                zerif_paging_nav();
            else :
                get_template_part('content', 'none');
            endif;
            ?>
        </main><!-- #main -->
    </div><!-- #primary -->
</div><!-- .content-left-wrap -->

Wątpię. Uważam, że jest odwrotnie. Dlatego odkąd zobaczyłem kilka
przykładów znaczników w każdej linii kodu, zastanawia mnie sens tego.
Technical Details
Message-ID: <mm254n$gef$1@node1.news.atman.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
References: <mm1eoe$ol5$1@node1.news.atman.pl> <55845177$0$2189$65785112@news.neostrada.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From: Minu <Minu@ab.ab>
Newsgroups: pl.comp.lang.php
Subject: Re: czym kierują się ludzie
 piszący każdą linie kodu PHP w osobnych
 znacznikach <?php ?>
Date: Sat, 20 Jun 2015 00:29:43 +0200
Organization: ATMAN - ATM S.A.
Lines: 64
Message-ID: <mm254n$gef$1@node1.news.atman.pl>
References: <mm1eoe$ol5$1@node1.news.atman.pl> <55845177$0$2189$65785112@news.neostrada.pl>
NNTP-Posting-Host: 89-72-56-232.dynamic.chello.pl
Mime-Version: 1.0
X-Trace: node1.news.atman.pl 1434752983 16847 89.72.56.232 (19 Jun 2015 22:29:43 GMT)
X-Complaints-To: usenet@atman.pl
NNTP-Posting-Date: Fri, 19 Jun 2015 22:29:43 +0000 (UTC)
In-Reply-To: <55845177$0$2189$65785112@news.neostrada.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit