Skip to content

Overriding_core_functions_and_classes

Cameron edited this page Jan 28, 2017 · 1 revision

title: Overriding core functions and classes permalink: /Overriding_core_functions_and_classes/

As of v0.7, e107 has the ability for themes and plugins to override core functions and classes and define them for themselves.

The following can be overridden:

  • tablerender()
  • render_newsitem()

To override these you do the following from your plugins e_module.php file. See Modules or the section on theme overrides for the procedure for overriding from theme.php):

Please note - there are rules to prevent multiple plugins and themes causing a parse error when they all try to override the same code. The rules are that each in turn overrides the other's override code in this order:

plugin 1 => gets overridden by plugin 2 => which gets overridden by theme

Because of these potential conflicts its advisable to find alternative ways of achieving your aim without using overrides.

In the following example code you replace 'yourplugin' with the directory name of your plugin and place your alternative code to the default core code where we have placed the example echo "overridden"; code. This block of code will be used instead of the core code it is replacing.

tablerender

Location

class2.php

Description

This is the function that takes the data output of a menu and passes it to your themes tablestyle() function in order to be rendered and displayed on your page.

For tablerender():

Category:API Category:PluginWriting

Clone this wiki locally