By: martijn
Date: 2006-12-26
Time: 10:21
|
Wrapping LoadTemplate in another functionHi,
I'd like to make a wrapper for the LoadTemplate function, that does not lose it's functionality. This is because I have a constant containing the path to the template directory so that people would only have to specify the template file. I've got an idea on how to make this work but am not sure, something like this:
|
|
By: Skrol29
Date: 2006-12-28
Time: 00:03
|
Re: Wrapping LoadTemplate in another functionHi,
This wrapper can be done with a TBS plug-in. As is it quite simple, you can do it with a function instead of a class. Here is an example of how it can be coded. More information about coding plug-ins: http://www.tinybutstrong.com/manual.php#plugins
|
|
By: martijn
Date: 2006-12-28
Time: 08:37
|
Re: Wrapping LoadTemplate in another functionHi, thanks for your reply but I get this error:
|
|
By: sheepy
Date: 2006-12-28
Time: 09:16
|
Re: Wrapping LoadTemplate in another functionI simply warp the whole TBS with functions, all the way from loading template to displaying them. I hate forgetting the & sign in PHP4, functions needs no global var declaration and works really nice with code completion, plus it solves questions like yours.
|
|
By: Skrol29
Date: 2006-12-28
Time: 10:44
|
Re: Wrapping LoadTemplate in another functionHi,
I forgotten this little function needed to install the plug-in:
|
|
By: martijn
Date: 2006-12-28
Time: 17:40
|
Re: Wrapping LoadTemplate in another functionThanks a bunch, it works now! :)
Makes things much easier! |
|
By: martijn
Date: 2006-12-29
Time: 07:36
|
Re: Wrapping LoadTemplate in another functionI know I should open a new thread so I hope you don't mind me posting it anyway.
I'm trying to implement a tags function for my site. The tags are stored in a MySQL row called 'tags', like this: tag1 tag2 tag3 (so they're separated by spaces). I'm able to put these tags in their own array: $tag[] = 'tag1'; $tag[] = 'tag2'; ... But when I try to list them in my template, they do get listed, but the element that is specified in 'block=' is added after the official end of the array. <li>tag1</li> <li>tag2</li> |>| <li></li> |<| for example. Here's the PHP code:
|