What PHP is trying to tell you is that the property ->plugins_dir
doesn't really exist, but a magic __get()
function has been written that will return a value if you read from it. Assigning a variable directly to it might also work (if there is a corresponding __set()
) but you cannot modify it, since it is actually a function return value. You are effectively trying to say $this->__get('plugins_dir')[0] = 'foo'
, which doesn't mean anything.
However, looking at the relevant Smarty documentation, we can see what the correct solution is:
Note: As of Smarty 3.1 the attribute $plugins_dir is no longer accessible directly. Use getPluginsDir(), setPluginsDir() and addPluginsDir() instead.
So your code should actually use the pattern of one of the examples on the doc page for addPluginsDir(), such as:
$this->setPluginsDir( SMARTY_DIR . 'plugins' )
->addPluginsDir( '/some/other/source/of/plugins' );