MyBB Community Forums

Full Version: Template System
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Does anyone know of a template system that works in a similar way to the mybb, basically what I want is the html stored in the db say.

<b>{$username}</b>

is in a database row in my template table.

then in the code i do something like

$username = "Aaron";

echo $template->("username");

I don't want to have to set the $username in an array, similar to mybb. Any ideas? Sorry if it's a bit vague.
to what end? what are you applying it to? i get what you are saying, but i do not know of any standalone plugin systems that are not wrapped into some other package.
Yeah, I'm working on something for work, just want to be able to keep the templates in a database like myBB and use them like above.
just make your own. for a basic template system its not too difficult, especially if the variables are pretty well fixed.
I understand how to do it with fixed variables within an array, was wondering how mybb did it?
Well I'm no programmer but would it just call it based on user logged in. Thus it retrieves it from the users table. I wouldn't know how to do it exactly but like I said I'm no programmer.
I'm confused - what exactly are you trying to do? Set it up so you can use $user['username'] or..?
No, store templates in a database with variables like {$username} and replace them, without having to use arrays like most template systems, I wan't one like myBB's.
Why not use MyBB's? You can probably strip it out easily enough.
I was going to look into that, class_templates i presume is where the bulk of it is, any ideas if more would be elsewhere?
Pages: 1 2