Welcome Guest, Not a member yet? Register   Sign In
in the view, php embedded into html or php echo the whole html?
#3

[eluser]searain[/eluser]
Just wondering why people do that. CI or not, I never saw the advantages of echo all strings to create html page, from day 1 when I get to web programming (asp then). But I saw many experts do that. Such as in many book examples, many authors do that.

I always prefer like this
Code:
<?php
if (count($article_categories)){
?>
    <table border='1' cellspacing='0' cellpadding='3' width='400'>
        <tr valign='top'>
            <th>ID</th><th>Name</th><th>Status</th><th>Actions</th>
        </tr>
&lt;?php
    foreach ($article_categories as $key => $list)
    {
?&gt;
        <tr valign='top'>
            <td>&lt;?php echo $list['id']; ?&gt;</td>
            <td>&lt;?php echo $list['name']; ?&gt;</td>
            <td align='center'>&lt;?php echo $list['status']; ?&gt;</td>
            <td align='center'>&lt;?php echo  anchor('admin/articles/article_categories/edit/'.$list['id'],'edit'); ?&gt; | &lt;?php echo  anchor('admin/articles/article_categories/delete/'.$list['id'],'delete'); ?&gt;</td>
        </tr>
&lt;?php
    }
?&gt;
    </table>
&lt;?php
}
?&gt;


Messages In This Thread
in the view, php embedded into html or php echo the whole html? - by El Forum - 06-29-2009, 04:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB