Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Clone this wiki locally
MidCOM Components are reusable modules which provide a set of defined functionalities. There are components for many common web tasks, like blogs, wikis, slideshows and also complex applications like OpenPSA, which combine multiple components.
Besides the regular components, which are bound to a Topic, there is also a number of so-called Purecode Components, which provide functionality that can be included in other code (like the commenting system), or that is accessible via the browser (like the on-site administration tools).
These are the folders/files you will typically encounter in components:
||contains the [Component Manifest](Component Manifests), a [config file](Component Configuration), the Routing information, and optionally the default Datamanager Schemas|
||holds the component's cron jobs, if any|
||contains the component's documentation|
||for scripts called with the [MidCOM URL Method](MidCOM URL Methods)
||contains the request handler classes|
||contains files with the defined localization strings|
||contains the component interface class|
||contains the Component's default Style Elements|
||integration into the Navigation service|
||integration into the Routing system|
All components have to provide
midcom/interfaces.php (which extends
midcom_baseclasses_components_interface) so that the framework is able to work with them.
Non-Purecode components additionally have to provide
navigation.php (which extends
viewer.php (which implements
Each Component has a unique name, which is constructed similar to names
a Java packages and consists of the web address of the organization or
person who wrote the Component and an identifier. For example:
de.linkm.newsticker is the newsticker Component
written by an organization with the web address
The Component's name also serves as a prefix to the Component's classes,
and so on.
Starting with OpenPSA 9, components can be installed via Composer. A number of Components is bundled in the main repository. They provide basic features like the adminstration interface (Asgard) and tools for site management.
Working with Style Elements
MidCOM Components store data relevant to the current request within the
component context in the variable
$data, which is also available to
Style Elements, and can thus be used to produce or
modify the Component Output. Style Elements can be called during the
Content Output Phase from the Style elements
[/style-finish](style-finish). Each non-Purecode Component comes
with a number of default Style Elements that can be overwritten. See
Style Engine for details.
Components are able to access the functionality of the MidCOM framework through inheritance of the Component Baseclasses. Usually, they are linked to Topics and make their functionality (class methods and data output) available, which consist mostly of Style Elements, included Snippets and content.
//regular components: midcom::get()->componentloader->load('net.nehmer.static'); //purecode components: midcom::get()->componentloader->load_library('midcom.admin.folder');