News:

AbanteCart v1.4.2 is released.

Main Menu

Do you like AbanteCart? Please rate AbanteCart or share your experience with other eCommerce entrepreneurs. Go to Softaculous rating page to add your rating or write a review

extend or hook

Started by natdroid, March 20, 2019, 07:25:51 AM

Previous topic - Next topic

natdroid

How to extend or replace function with my own in /core/engine/controller.php ?


https://github.com/abantecart/abantecart-src/blob/master/public_html/core/engine/controller.php#L392

Any help would be greatly appreciated.

abolabo

Please explain what the aim?
"No one is useless in this world who lightens the burdens of another."
― Charles Dickens

abolabo

hmm...
may be better to create empty file /javascript/jquery-1.12.4.min.js inside of your  extension?

$this->templateResource() is a method of AView class, not AController.

It looking into extensions for needle first

    public function templateResource($filename, $mode = 'http')
    {
        if (!$filename) {
            return null;
        }
        $http_path = '';
        $res_arr = $this->_extensions_resource_map($filename);
....


"No one is useless in this world who lightens the burdens of another."
― Charles Dickens

abolabo

Quote from: abolabo on March 20, 2019, 09:08:14 AM

may be better to create empty file /javascript/jquery-1.12.4.min.js inside of your  extension?


Did you already tried this?
"No one is useless in this world who lightens the burdens of another."
― Charles Dickens

abolabo

Yes, i know. You cannot to override function of AController. It's a core base abstract controller. 
You should to manipulate your js and css via tpl-replacements, pre- and post- tpls of your extension,
or effect on ADocument class from your hooks ($this->document->addScript(); ). 
Not sure that approach with disabling some js files from extension is good. Extension is one of many and can conflict with other
"No one is useless in this world who lightens the burdens of another."
― Charles Dickens

Forum Rules Code of conduct
AbanteCart.com 2010 -