Joomla 3.1 Override Libraries

徘徊边缘 提交于 2019-12-23 12:16:37

问题


I have a Joomla 3 website and want to override

libraries/cms/html/html.php.

Is it possible?

I tried to use same technique described here How to override Joomla System Messages - message.php template

I put my html.php file in templates/MY_TEMPLATE/html/html.php

this does not help, neither helps if I put in my template index.php file the following:

require_once JPATH_ROOT .'/templates/'. $this->template .'/html/html.php';


回答1:


You can't override it using template overrides. It's an issue we have in Joomla which isn't solved yet.

The only way to override library files is if you provide a system plugin which will register an additional library path to the autoloader. Then it should be possible to override such classes. See http://developer.joomla.org/manual/ch01s04.html for information about the autoloader and how to register own libraries.



来源:https://stackoverflow.com/questions/19398302/joomla-3-1-override-libraries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!