pockets into php files
JoZ3_69
✭
Hi, is it possible to use pockets within a php file? I need a certain pocket to appear, depending on the category, between the comments. I used the following for pockets located at the top of the website, into the file default.master.tpl:
{$categorias = array("50","56","57","58")}
{if $Category.CategoryID|in_array:$categorias }
{pocket name="pocket_01"}
{else}
{pocket name="pocket_02"}
{/if}
Now i need put this code into themes/mytheme/views/discussion/index.php
I appreciate any help.
0
Comments
Look at the function.pocket.php Smarty plugin, it contains the following code:
function smarty_function_pocket($params, $smarty) { if (!class_exists('PocketsPlugin')) { return ''; } $name = val('name', $params); unset($params['name']); $result = PocketsPlugin::pocketString($name, $params); return $result; }Therefore, if you directly wan to use php, I guess it should work with
echo PocketsPlugin::pocketString('pocket_01');@R_J thanks mate for the help, it work fine :)