全屏

位置 : Joomla!中文文档库 > Plugin Developer Overview
Plugin Developer Overview
推荐给朋友

Plugin Developer Overview

Overview

New in Joomla! 1.5 is a JPlugin class. In the effort to move Joomla! toward a more efficient object-oriented framework a new plugin system has been developed. Plugins are observer classes that attach to a global event dispatcher object in the Joomla! core. What does this mean in english? It means that either the Joomla! core or a third party component or module can trigger an event which causes one or more plugins to execute some code. Isn’t this the same as a mambot? No, not exactly. It is similar in basic principle in that both a plugin and a mambot are triggered by an event and both execute code. One issue with a mambot is that it requires its functions to be declared in a global scope. Since a JPlugin is a class, the methods that handle the events can share variables and have private helper methods as well, which makes for a much cleaner system for handling events.

Joomla1.5中加入新的JPlugin类。在努力推动Joomla为一个更有效的面向对象框架中一个新的plugin系统以成熟。Plugins是observer类它与Joomla核心中的一个全局的事件派送对象相关联。在英文中是什么意思哪? 这意味着无论是Joomla !核心或第三方组件或模块可以触发一个事件从而导致一个或多个插件来执行一些代码。难道这和mambot不一样?不,不完全。相似的基本原则是在一个plugin和mambot触发事件并执行代码,区别在于mambot需要处理的函数必须在全局范围内以声明。因为JPlugin是一个类,

 


菜单

类别目录