简体   繁体   English

在Joomla中创建管理表(后端)-用于自己的插件/模块/组件

[英]Creating admin table (backend) in Joomla - for own plugin/module/component

I want to create an custom table in the /administrator (back-end) with my plugin (or component/module, if plug-ins cannot do it for me), so I can populate it with some data that administrator can manage. 我想在/administrator (后端)中使用我的插件(或组件/模块,如果插件不能为我做一个)创建一个自定义表,因此我可以用一些管理员可以管理的数据来填充它。

By table , I mean the table with form and default buttons (like filter ect). 所谓 ,是指带有表单和默认按钮(如filter ect)的表。 The example of such table added by VirtueMark2 component to Joomla: 由VirtueMark2组件添加到Joomla的此类表的示例: 在此处输入图片说明

I have noticed some common elements of all such tables in Joomla back-end (like eg filter, sorting, same buttons, style, html structure), so I guess they are not written "from hand", but by some special commands/functions/methods called by plugin/component/module. 我注意到Joomla后端中所有此类表的一些常见元素(例如过滤器,排序,相同的按钮,样式,html结构),因此我想它们不是“手工编写”的,而是由一些特殊的命令/功能编写的/插件/组件/模块调用的方法。

I already know how to add custom fields to my plugin, via XML file of that plugin, like: 我已经知道如何通过该插件的XML文件向该插件添加自定义字段,例如: 在此处输入图片说明

Joomla supports a variety of extension types, Components , Modules and Plugins being the most commonly considered extensions. Joomla支持多种扩展类型,其中ComponentsModulesPlugins是最常用的扩展。 Other extension types supported by the Joomla Extension Manager are Templates and Libraries. Joomla扩展管理器支持的其他扩展类型是模板和库。

A Joomla Component provides "the main functional units of Joomla!; they can be seen as mini-applications". Joomla组件提供“ Joomla!的主要功能单元;可以将它们视为小型应用程序”。 The Joomla Doc's website has a Component Development Portal that includes all the relevant tutorials for version 2.5.x of Joomla and the newer 3.x versions . Joomla Doc的网站上有一个组件开发门户 ,其中包括有关 Joomla的2.5.x版和更新的3.x版的所有相关教程

From your screenshots you're using Joomla 2.5.x. 从屏幕截图中,您正在使用Joomla2.5.x。

When creating an extension, the Joomla installer will look for an install SQL file in which you can define the creation of your table and any standard records. 创建扩展程序时,Joomla安装程序将查找一个安装SQL文件 ,您可以在其中定义表和任何标准记录的创建。 Additionally, it will look for a PHP script to execute as part of the installation/update , called script.php which allows you to execute methods on, first install() , or subsequent update() 's and to run a preflight() check or a postflight() clean up. 此外,它将寻找PHP脚本作为安装/更新的一部分执行 ,称为script.php ,它允许您在first install()或后续update()上执行方法并运行preflight()检查或postflight()清理。 There's even an uninstall() method you can use to clean-up after the user decides to uninstall your extension. 用户决定卸载扩展程序后,甚至还可以使用uninstall()方法进行清理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM