joomla前台组件的学习总结
2009-07-13 16:49
375 查看
1、结构:(组件名为:selfRegistration)
这是joomla前台组件必须的基本结构
红色为文件夹
2、主要文件的骨干代码
selfRegistration.php
controller.php
view.html.php(这个是从models类里面传递参数到defined.php)
defined.php主要是网页布局的
models下的selfRegistration.php包含了models类,可以创建连接操作数据库的函数之类
这是joomla前台组件必须的基本结构
红色为文件夹
2、主要文件的骨干代码
selfRegistration.php
<?php /** * @date 2009-07-15 * @author Pandar * @package selfRestration * @subpackage Components * @link * @license GNU/GPL */ defined('_JEXEC') or die('Restricted access'); // Require the base controller require_once (JPATH_COMPONENT.DS.'controller.php'); // Require specific controller if requested if($controller = JRequest::getVar('controller')) { require_once (JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php'); } // Create the controller $classname = 'SelfRegistrationController'.$controller; $controller = new $classname( ); // Perform the Request task $controller->execute( JRequest::getVar('task')); // Redirect if set by the controller $controller->redirect(); ?>
controller.php
<?php /** * @date 2009-07-15 * @author Pandar * @package selfRestration * @subpackage Components * @link * @license GNU/GPL */ jimport('joomla.application.component.controller'); class SelfRegistrationController extends JController { function display() { parent::display(); } } ?>
view.html.php(这个是从models类里面传递参数到defined.php)
<?php jimport('joomla.application.component.view'); class SelfRegistrationViewSelfRegistration extends JView { function display($tpl=NULL) { $model=&$this->getModel(); $this->assignRef('greeting',$greeting); $this->assignRef('pandar',$pandar); parent::display($tpl); } } ?>
defined.php主要是网页布局的
models下的selfRegistration.php包含了models类,可以创建连接操作数据库的函数之类
相关文章推荐
- Bootstrap学习总结笔记(15)-- 基本组件之进度条
- [Python] wxPython 状态栏组件、消息对话框组件 学习总结(原创)
- Android-学习记录-四大组件总结(2)
- android 四大组件之service学习总结(一)
- joomla1.5前台组件开发过程分享(附中文开发教程两本)
- EasyUI学习总结(三)——EasyUI组件使用
- 日志组件log4net学习总结
- dNet图像处理组件学习总结
- 四大组件学习实例总结之Content Provider
- Extjs学习总结之16组件component
- [Python] wxPython 编辑框组件学习总结 (原创)
- Bootstrap学习总结笔记(7)-- 基本组件之下拉菜单
- bootstrap学习总结-css组件(三)
- EasyUI学习总结(五)——EasyUI组件使用
- JSP 学习总结 03 核心组件 Servlet
- 《第一行代码》第二版 学习总结30 前台服务基本使用
- Bootstrap学习总结笔记(8)-- 基本组件之按钮组
- Vue1.0学习总结(4)———Vue1.0自定义组件、Vue1.0组件之间的通信、slot的使用
- 自定义组件学习与总结