Welcome Guest, Not a member yet? Register   Sign In
A New Understanding of CI
#7

[eluser]nate_02631[/eluser]
@esra - yes, there are always "other ways" of doing things Wink ... the point of my prior post was to refute the somewhat inaccurate definitions of the poster above...

As to point #1, I don't work with template designers myself but any logic that is contained in the view would be the most remedial PHP there is, and any designer worth their salt would be able to pick it up in a matter of minutes. Personally, I find it a little sloppy to load up variables in the controller with HTML or other display stuff and strive for a pure separation of output in views.

That being said, the extent of php logic in my view is:
Code:
<p>&lt;?= $this == $that ? 'This is That' : 'This is NOT that' ?&gt;</p>

&lt;? if ($this == $that): ?&gt;
  <p>Conditional "blocks" used for displaying</p>
  <p>more than one line of HTML...</p>
&lt;? endif ?&gt;

<ul>
  &lt;? foreach ($items->result() as $item): ?&gt;
    <li>&lt;?= $item->name ?&gt;</li>
  &lt;? endforeach ?&gt;
</ul>
This has the advantages of keeping a strict separation of views (so you always know where to look for output), and provided your template designer is savvy, gives them *complete* control over the look of the page.


Messages In This Thread
A New Understanding of CI - by El Forum - 10-28-2007, 09:33 PM
A New Understanding of CI - by El Forum - 10-29-2007, 02:00 AM
A New Understanding of CI - by El Forum - 11-17-2007, 09:10 AM
A New Understanding of CI - by El Forum - 11-17-2007, 06:32 PM
A New Understanding of CI - by El Forum - 11-17-2007, 07:00 PM
A New Understanding of CI - by El Forum - 11-17-2007, 09:36 PM
A New Understanding of CI - by El Forum - 11-18-2007, 08:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB