Skip to content

alex7r/overrideany

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

overrideany

Overrides any method you want in Joomla! CMS

example

For now plugin is hardcoded to override ContentModelCategory with file at /core/content/models/category.php

You can change or add inital(file to override) file and target (file with override) file by changing next lines in the constructor:

/* EXAMPLE */
$overridables['CLASSTOOVERRIDE']['initial'] = JPATH_BASE . '/components/com_content/models/category.php';
$overridables['CLASSTOOVERRIDE']['target']  = JPATH_BASE . '/core/content/models/category.php';

Conten of /core/content/models/category.php might be like

class ContentModelCategory extends ContentModelCategoryBase
{
	public function getItems(){
	    echo "Overrided!!!";
	    return parent::getItems();
    }
}

p.s. with, or without <?php at the start of the file

About

Overrides any method you want in Joomla! CMS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages