Documentation

Components

Overview

The largest and most complex of the extension types, a component is in fact a separate application. You can think of a component as something that has its own functionality, its own database tables and its own presentation. So if you install a component, you add an application to your website. Examples of components are a forum, a blog, a community system, a photo gallery, etc. You could think of all of these as being a separate application. Everyone of these would make perfect sense as a stand-alone system.

Throughout these articles, we will be using {ComponentName} to represent the name of a component that is variable, meaning the actual component name is chosen by the developer. Notice also that case is important. {componentname} will refer to the lowercase version of {ComponentName}, eg. "CamelCasedController" -> "camelcasedcontroller". Similarly, {ViewName} and {viewname}, {ModelName} and {modelname}, {ControllerName} and {controllername}.

Examples

In the com_drwho example component, we demonstrate working with an MVC structure, basic usage of the database ORM, and more. The admin and site examples show how to output a listing (with pagination), a form for entering new items, and saving to the database.

Other examples included are using multiple controllers, using models, handling errors, adding some security, and pushing assets (e.g., CSS) to the document.

Example usage of the API is also included.

Download: Doctor Who component

Last modified:

  • Copyright © 2022 Hubzero
  • Powered by Hubzero®