Ninjakreborn Posted June 26, 2008 Share Posted June 26, 2008 I hav a varible that is passed into the view it's $subarealist. There is something I need to do using {php}{/php} tags but when I try to access it via $subarealist the array is not there. It works in Smarty like normal {$subarealist} but it does not work in php tags like that. I tried {$subarealist}, $subarealist, I tried setting it to global like {php} global $subarealist; echo '<pre>'; print_r($subarealist); echo'</pre>'; {/php} That comes back with nothing. What do I need to do specifically to make php give me access to that variable. Inside of cakes controller that variable is both set to that variale as well as passed into the view (both). Quote Link to comment https://forums.phpfreaks.com/topic/112025-solved-how-do-i-quotaccessquot-variables-inside-of-smarty-php-tags/ Share on other sites More sharing options...
DyslexicDog Posted June 26, 2008 Share Posted June 26, 2008 Are globals disabled? Quote Link to comment https://forums.phpfreaks.com/topic/112025-solved-how-do-i-quotaccessquot-variables-inside-of-smarty-php-tags/#findComment-575023 Share on other sites More sharing options...
Ninjakreborn Posted June 26, 2008 Author Share Posted June 26, 2008 Not sure but I just got it working. $subarealist = $this->_tpl_vars['subarealist']; Quote Link to comment https://forums.phpfreaks.com/topic/112025-solved-how-do-i-quotaccessquot-variables-inside-of-smarty-php-tags/#findComment-575032 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.