Post by Joe1234 » Fri Jun 07, 2024 9:10 pm

If I want to load a file and access it's functions in the admin I would do:

Code: Select all

$this->load->model('');
$this->model_file->function();
How would I do this if I wanted to load a file and function in the catalog dir from the admin dir? Or do I just have to recreate the model file in the admin dir?

v3.0.3.9 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by ADD Creative » Fri Jun 07, 2024 9:28 pm

The loader will only load a model from DIR_APPLICATION , which will be set the admin directory for the admin side. If it's new code you are sharing you could add to system/library.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by paulfeakins » Mon Jun 10, 2024 6:59 pm

Joe1234 wrote:
Fri Jun 07, 2024 9:10 pm
How would I do this if I wanted to load a file and function in the catalog dir from the admin dir?
This has been asked a lot of times, please always search before posting.

Short answer: with difficulty.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 70 guests