mcpacific Posted May 22, 2014 Share Posted May 22, 2014 (edited) I am creating a custom module, for which I have the following function: function mymodule_ClientArea($vars) { return array( 'templatefile' => 'clienthome', 'vars' => array( 'test1' => 'hello', 'test2' => 'world', ), ); } In my file 'clienthome.tpl' I have the following: {php} echo $vars['test1'].'<br>'; {/php} It seems that the variable isn't being passed, nothing shows. If I apply gettype($vars), it returns null. What am I doing wrong? Edited May 22, 2014 by la_rollin 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted May 22, 2014 Share Posted May 22, 2014 you may need to call the variable like that: {$test1} 0 Quote Link to comment Share on other sites More sharing options...
mcpacific Posted May 22, 2014 Author Share Posted May 22, 2014 you may need to call the variable like that: {$test1} I tried that also, but it doesn't work either. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted May 22, 2014 Share Posted May 22, 2014 note: you need to place "clienthome.tpl" inside the addon module directory 0 Quote Link to comment Share on other sites More sharing options...
mcpacific Posted May 22, 2014 Author Share Posted May 22, 2014 (edited) note: you need to place "clienthome.tpl" inside the addon module directory Yes, of course. Although, I assume you meant the modules/servers/mymodule folder. Edited May 22, 2014 by la_rollin 0 Quote Link to comment Share on other sites More sharing options...
mcpacific Posted May 23, 2014 Author Share Posted May 23, 2014 Ok, well I figured it out. I accidentally left off the dollar sign... it should be {$test1}. Thank you sentq! I guess I didn't notice that in your reply. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.