Welcome Guest, Not a member yet? Register   Sign In
using a variable to represent a class? Can anyone help
#1

[eluser]prestondocks[/eluser]
Hi, Can anyone enlighten me on how to set a property in a class, where the class name is held in a variable.

I am trying to set a class property based on the value of class name in $this->router->class. I have tried $this->router->class::view_data['site_name'] = 'xyz' but as I expected I get a php error

The exact error being
Code:
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in C:\xampp\htdocs\intranet\system\application\modules\site\models\site_model.php on line 7

Can anyone help me out.

Thanks
Simon


Messages In This Thread
using a variable to represent a class? Can anyone help - by El Forum - 08-15-2010, 03:01 PM
using a variable to represent a class? Can anyone help - by El Forum - 08-15-2010, 03:40 PM
using a variable to represent a class? Can anyone help - by El Forum - 08-16-2010, 12:09 AM
using a variable to represent a class? Can anyone help - by El Forum - 08-16-2010, 05:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB