Application Basic Concept

An application acts as the main controller of a page. In a page, there can only be one application at a time since it acts as a controller, receiving requests from the URL. However, this does not take into account other applications that can be called from a block. In order for an application to be considered valid, it must meet the following criterias:

  • Inherits from any class that inherits from cmsApplication_Basic
  • Has an admin javascript view controller, inherited from any class that inherits from SCHLIX.CMS.BaseController javascript class
  • Contains an install and uninstall SQL script with extension .sql
  • Contains a backend view (view.admin.main.template.php) for main administration view
  • Contains a frontend view (view.main.template.php) for user-facing site
  • If your class lists category/items, it should also contain the necessary view file.
  • Contains packageinfo.inc.php, an info file containing GUID, package name, author's email, etc.

A sample of an application directory containing the necessary files

App Sample Structure

If you have never developed a SCHLIX CMS plugin before, it is highly recommended to use the Plugin Creator to simplify this task.

  • Main classes: EzEvent (ezevent.class.php) and EZEvent_Admin (ezevent.admin.class.php).
  • Frontend view templates: view.item.template.php, view.category.nested.template.php, view.main.template.php
  • Backend view template: only view.main.admin.template.php
  • Backend editor template: edit.item.template.php and edit.category.template.php
  • Backend configuration file: config.template.php
  • Logo: ezevent_logo.png
  • Install/uninstall SQL script: install.sql and uninstall.sql

An application may also contain another class. For instance, Users class has a subclass Users_History class and the purpose is to list and record user actions.

At the very basic, an application does the following thing

  • Display the page title
  • Display relevant information for the search engine: meta description, meta keywords, etc
  • Display its content
  • Execute a command passed through the Run($command) function, where $command may be a parameter of $_GET['action'] or something else as interpreted by the interpretFriendlyURL() (which you can customize and override in your class).