PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am trying to call getIsAdmin function from another class but getting "Error 500-Trying to get property of non-object"...I am new to PHP so not aware
how to resolve..
I tried to check var_dump also, it's showing "boolean false"
First of all thx for your time and help in resolving the issue.
I am just trying to call getIsAdmin function which is another class.....
Below are some images & delete access of records .....are working fine....but I don't want user to have access to delete option...
With admin all is working fine so was trying to call function to check whether the logged one is admin or user....
$deleteButtonUrl = 'array("delete", "id" => $data->id)';..
Also I tried like this
function __construct(WebUser $WebUser) but didn't worked got error..Argument 1 passed to ButtonColumn::__construct() must be an instance of WebUser, instance of GridView given
I got your point but what is the way to resolve it as I am able to get the admin value from database but when I am putting in if statement getting error i.e.Trying to get property of non-object.......
It would be helpful to see the complete error message and to tell us what line the error message is referring to. PHP error messages are very clear. Your error message ("Trying to get property of non-object") means you are doing $foo->bar but $foo is not an object. Usually this is because a function/method is returning null or false instead of an object.