Click here to register.
      

Designing in a PHP World

Design Squid
Other Design Articles
Designing in a PHP World
preaction · 4/1/2009 1:54 pm
Design Squid

With the recent news that WebGUI is moving to PHP, it's important that your fears over such a huge move are assuaged. Luckily, your stalwart blogger has just that information!

Many are the complaints with WebGUI's current template system. It's too easy to use (and screw up) and yet it's not powerful enough to do everything. It even looks like HTML, so it's impossible to tell from real HTML, which makes learning difficult. Finally, macros are so quirky as to be almost unusable! It's a wonder that WebGUI works at all!

Worry nevermore! With our move to PHP, the role of the designer has been completely eliminated! Now, all programmers are designers, too. Your current designers will only need a 2-year associate's degree in Computer Science to edit the new PHP-based templates. Nothing could be easier!

Let's take a piece of example code from a WebGUI template:

<tmpl_loop posts>
  <tmpl_if user_profile_is_public><a href="<tmpl_var user_profile_url>"></tmpl_if>
  <tmpl_var user_name>
 <tmpl_if user_profile_is_public></a>
 <h2><tmpl_var title></h2>
 <div class="post"><tmpl_var content></div>
 <tmpl_loop comments>
  <tmpl_var user_name> - <tmpl_var comment>
</tmpl_loop>
</tmpl_loop>

Line noise, right? I'm a professional and I can barely read that! But look at the same template in the new WebPHooPie Template Engine:

for ( $count = 0; $count < @posts; $count += 1 ) {
if ( @posts[$count]->user->profile->is_public ) {
echo "<a href=\"";
echo @posts[$count]->user->profile->url;
echo "\">";
}
echo @posts[$count]->user->username;
if ( @posts[$count]->user->profile->is_public ) {
echo "</a>";
}
echo "<h2>";
echo @posts[$count]->content;
echo "</h2>";
for ( $countb = 0; $countb < @posts[$count]->comments; $countb += 1 ) {
echo @posts[$count]->comments[$countb]->user_name;
echo " - ";
echo @posts[$count]->comments[$countb]->comment;
}
}

Wow! The new template system is so easy a high school student could do it! Your designers have to be at least as intelligent as the average high school nerd. I mean, people who still watch the original Star Trek series can't be that smart anyway.

Join your stalwart blogger next month when we discuss how we're moving the entire database API layer into a JavaScript module for increased security!

·
Stick
Lock
Subscribe