Skip to content
Advertisement

how to use function from another class in flight php

I am new in flight php. I need some help, I create two classes client.class.php and deliveryServiceConnector.class.php and i have index.php. I want to use function from deliveryServiceConnector.class.php in client.class.php so I write this code:

JavaScript

I got this error:

Undefined variable: connector (8) Any idea how can i fix my error, Thanks

Advertisement

Answer

You’re not using the same thing for the deliveryServiceConnector. In the first line, inside the function, you use $this->connector, but in the second line you use $connector. Therefore it is undefined. Try to use the same thing twice. Either:

JavaScript

or

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement