Hi,
What is the expected way to use a class both within the catalog and also admin? is it to use the init system? or do I just need to do a normal "require", store the class in the catalog classes directory and fiddle about with the require path?
Hi,
What is the expected way to use a class both within the catalog and also admin? is it to use the init system? or do I just need to do a normal "require", store the class in the catalog classes directory and fiddle about with the require path?
You'd place your new class file in /includes/classes/new_class.php. To load the class file, on the store-front side, you'd use:
On the admin side, you'd useCode:require(DIR_WS_CLASSES . 'new_class.php');
That's "assuming" that the class is not required to be loaded for each and every page in store-front and admin. If that's the case for you, post back and I'll provide an update.Code:require(DIR_WS_CATALOG . 'includes/classes/new_class.php');
Last edited by lat9; 27 Oct 2013 at 03:44 PM. Reason: Add details
Bookmarks