concept logic in category php

appears as: logic, The logic, logic
PHP in Action: Objects, Design, Agility

This is an excerpt from Manning's book PHP in Action: Objects, Design, Agility.

In principle, an if-then-else statement is an idea that’s obvious to anyone who speaks English. In practice, the logic of an if-then-else or switch construct is often hard to follow. The statements are often nested, the logical expressions complex. Sometimes, the legs of the conditional are so long that it’s hard to see where they start and end.

13.4. Keeping logic out of templates

Most web application pages have a relatively simple structure, such as a form or a simple list. A loop and perhaps a few simple conditionals will suffice as logic for the presentation. That’s no big problem in a template, since this minimal logic doesn’t obscure the HTML layout of the page much.