Jump to content

[SOLVED] QuickSkin template system


Jaguar

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?

Link to comment
https://forums.phpfreaks.com/topic/148153-solved-quickskin-template-system/
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.

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?

Archived

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

×
×
  • 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.