I have this PHP code block -:
$visible_to = 'private';
$icon = array('public' => 'ICON_GLOBE', 'private' => 'ICON_LOCK');
echo TbHtml::$icon[$visible_to];
But running this prints -: Access to undeclared static property: TbHtml::$icon.
Whats the problem with my code? Thanks :)
Heres the TbHtml class -:
class TbHtml
{
const ICON_GLOBE = 'Its a globe';
const ICON_LOCK = 'Its a lock';
}
$icon['public']& not take it as a simple string.