Quote:
Originally Posted by DragonBlade
|
Dragonblade,
I read this thread a month ago when I was first trying to figure out how to get all my php code into my custom pages. It didn't make much sense back then. It makes a little more sense now. I was planning on going live with my site next week. I assume the Plugin method I chose is ok for now.
I would like to understand the method in that thread though and if it makes sense I will redo my custom pages later when I have a more firm understanding of how to implement what the thread describes
"Now, with the result of the rendering we can do several things:
.
Output template directly - custom pages
So I'm trying to understand the post in that thread. So I have lots of pages of php + html. Its basically a complete php app. So with the plugin method I am assigning a variable to an entire page of php\html content and then placing that variable in the VB template (the one found via edit > templates).
In the article I am I doing something similar right? IE assigning a variable to a page of php\html?
I'm reading the passage below and trying to figure out exactly how my custom code gets assigned to a variable.
The code in each of my php pages is unique.
PHP Code:
$templater = vB_Template::create('mytemplate');
$templater->register_page_templates();
$templater->register('my_var', $my_var);
$templater->register('my_array', $my_array);
print_output($templater->render());
This immediatly outputs the template. Use this if you have created your own page, for example.
Note the second line, which is special for this type of use:
I'm a bit of a beginner when it comes to PHP coding.
"
/* Some Code, setting variables, (multidimensional) array */
$my_var = "abc";"
so they are defining the value of $my_var as "abc" ok so how to I set a variable to my php code. Would it be $my_var = "mycustomphp.php" ??
So using my 2 template examples above (what goes where using this method to output the contents of termsbody.php??