With conventional PHP development, dynamic pages are usually made up of PHP code and static content interleaved in a single script file.
When the designer and the coder are two separate persons (or simply when a designer needs to edit an already coded page) problems usually arise.
It's not uncommon for designers to simply edit the template file using a WYSIWYG HTML editor, without knowing anything about code sparse between markup elements, breaking existing functionality or causing PHP errors which are time-consuming to be tracked and fixed.
Wedgefish solves the problem by strictly separating HTML and PHP code generating output for an URL in two different files.
All HTML/XHTML code is stored in the "view", a static file containing no code at all, which can be freely edited using any available HTML editor, such as Quanta, NVU, Dreamweaver or Frontpage, while all PHP code is stored in the "controller", which does contain only code. This means there's no PHP code at all into HTML files!
Say goodbye to long, messy PHP files interleaved with HTML which only experienced coders can edit. The designer and the coder (when they're not the same person) will be able to work productively, without disturbing each other.
For the same reason, Wedgefish does not introduce any new "template language" which would require long learning curves and would be overwritten or removed by WYSIWYG HTML editors as well.
Another advantage of this separation is that the same controller can be reused with different view files, such as the same view file can be coupled with different controllers.
Each URL on the system may have a view and a controller, which are combined together by the template compiler, generating a PHP script which is stored in the code cache. The generated script (a conventional PHP file with code and static content interleaved) is executed as if it had been written by hand.
How are dynamic constructs defined
Objects on the page which should be repeated (or conditionally displayed or hidden) need to be marked with an "id"
property which name starts with uppercase "WOS_".
The "id" property will be removed in resulting output, to reduce its size.
If you need to keep the "id" property (because used by some CSS or JavaScript) just prefix the name with lowercase "wos_". In this case, the output id will not have the "wos_" prefix.
Example:
<div id="wos_content" class="text">$content</div>will be rewritten as
<div id="content" class="text">$content</div>The "id" property can also be set using Dreamweaver by clicking on an object and entering it in a textfield in the control area.
There are also designers out there who do not even know what "id" properties are, but you can stay assured they won't be easily deleted or overwritten like plain text (unless the careless designer deletes and redesigns the whole object from scratch, of course...)



