![]() |
str_replace and custom template
What am I doing wrong? I would like to do a string replace on postbit/postbit_legacy template. Find specific code, insert my custom template after it. Here is what I have and its not working.
PHP Code:
I tried this in postbit_display_complete and it doesnt work either. PHP Code:
|
I'm not sure, but I think maybe you need:
Code:
$parser = new vB_TemplateParser($templater->render()); (the ->render() added), since the vB_TemplateParser constructor takes a string. |
in the current postbit_display_complete code I get this error
Catchable fatal error: Object of class vB_Template could not be converted to string I need to be able to get a custom template and convert it into a string/variable. --------------- Added [DATE]1333780042[/DATE] at [TIME]1333780042[/TIME] --------------- and for some reason $templater = vB_Template::create('my_custom_template'); doesnt work in parse_templates (the way I am using it) |
Hmm...this thread has some code for doing a replace: www.vbulletin.org/forum/showthread.php?t=264690 Maybe it's fetch_template_raw() that you're looking for.
|
AWESOME! That worked!
parse_templates PHP Code:
|
Just as a side note here,
Notice how it's usually: $templater = vB_Template::create(); Then: print_output($templater->render()) The method create() returns an object. $repl_string, in your code, was an object- which explains your fatal error. |
All times are GMT. The time now is 06:12 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|