shahin0x Posted March 4, 2019 Share Posted March 4, 2019 hello I have a simple class that i want use it in controllers. how should i add this class? I put it on classes directory and added 'Core' keyword at the end of class name and extends it from 'ObjectModel' but it didn't work (ClassNotFoundException)! PS:1.7.x Link to comment Share on other sites More sharing options...
JBW Posted March 5, 2019 Share Posted March 5, 2019 Not sure why you put it in classes and added Core. If you want to use a class from another file you have to load this file with require_once. Link to comment Share on other sites More sharing options...
shahin0x Posted March 6, 2019 Author Share Posted March 6, 2019 10 hours ago, JBW said: Not sure why you put it in classes and added Core. If you want to use a class from another file you have to load this file with require_once. actually i want know how can i register class once and use it in else where Link to comment Share on other sites More sharing options...
JBW Posted March 6, 2019 Share Posted March 6, 2019 Maybe you want to use namespaces? http://php.net/manual/en/language.namespaces.php Link to comment Share on other sites More sharing options...
shahin0x Posted March 6, 2019 Author Share Posted March 6, 2019 6 hours ago, JBW said: Maybe you want to use namespaces? http://php.net/manual/en/language.namespaces.php does prestashop have auto class loader system? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now