Jump to content

Archived

This topic is now archived and is closed to further replies.

Jaguar

[SOLVED] QuickSkin template system

Recommended Posts

Does anyone use QuickSkin? http://quickskin.codeworxtech.com/ It uses syntax like <!-- IF true --> do this <!-- ELSE --> do that <!-- ENDIF -->

 

I really like the style, but it doesn't seem very popular or well supported. I know of Integrated Template, but from what I can tell it doesn't support if statements, which I want. Does anyone know of any similar template systems that support if statements, includes, and loops using HTML comment style?

Share this post


Link to post
Share on other sites

Why use a template engine to slow your application down? They simply add another layer of complexity. Any designer still needs to learn a new syntax, they may as well learn a little php. eg;

 

<html>
  <head>
    <title><?php echo $title; ?></title>
  </head>
  <body>
    <?php
      if ($contents) :
        foreach ($contents as $content) :
    ?>
      <h1><?php echo $contents['title']; ?></h1>
      <p><?php echo $contents['data'] ?></p>
    <?php
        endforeach;
      endif;
    ?>
  </body>
</html>

 

its just as simple IMO and much quicker then any template engine.

Share this post


Link to post
Share on other sites

Yeah, yeah.

 

I have my pages setup that way now. The problem I'm having is with my header file. It has a lot of variables and is included on many different pages. The problem is I do not set some of those variables on every page. So, warnings pop up. Yes, I know I can disable the warnings, but I'm anal and find warnings unacceptable.

 

The solutions are:

 

1. Use isset() in the header template file. I don't want to do this because I'm trying to keep functions of the template.

 

2. Set all the variables used in the header on every page. This seems wrong because I end up with a HUGE list of $var = NULL.

 

3. Use a template system that will convert <?php if($show_button): ?> (or <!-- IF show_button -->) to <?php if(isset($show_button) && $show_button): ?>. I know other template systems do this, but I prefer the HTML comment syntax.

 

4. ??? maybe you can think of something else?

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.