The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I dont think it is the same as a variable in php(although i'm not 100% on this). I think its a placeholder for a template engine( which would be a template variable). The template engine parses the template replacing {$VAR} with what $VAR is.

Ok...but he's talking about {$var} being in a template not a php script or string etc. Are you saying that by putting {$var} in a template file it will get replaced just like its in a string? I would be interested in knowing how you get this to work.

Well yes, I would guess that the template 'engine' consists more or less of a eval call.

I would have to disagree wtih you. Eval is known to be a bit slow, so that would be a pretty awful waste. I wrote a simple template engine that I'll share, that does what I need anyway (no where near the sophystication of Smarty, but I don't need Smarty or I'd use it. This templating engine is blazing fast for the basics).

It supports variables, and it supports a tag displaying another template. I use this on all my sites.

What kind of template files does invision boards use?
If they just use .php files as template then they won't need to do an eval().

--ed

(Sorry to post twice in a row)

IPB's skinning system is complex. I'm currently doing a job that needs integration. The /s1/skin_whatever.php file is a bunch of PHP functions with HTML in it. Each function just has a return, with an <<<EOF EOF; to output it. I presume the administration panel just calls the functions when neccesary to get the output, and does an actual fwrite to the PHP file appropriately (bit of coding work there I presume).

To call it, you go $this->html = $std->load_template("skin_whatever");, and then $this->html is a class. The class then lets you call functions and pass the variables to them. This is a pretty neat scheme, and is good for a developer, and I'm amazed at how they got the administration panel to work.

Edit: Oh, the main purpose of this post: IPB doesn't need eval, it's straight variables passed to the functions which are used.