webCOMAND

WebCOMANDApp

Model to be extended by the main class of a webCOMAND App.  Typically the only method defined in the main class of a webCOMAND App is the launch() method, which takes an associative array of options.  The launch method generally calls add_component() to add top-level components that make up the app's user interface.

Namespace: io_webcomand\models

UUID: 4d9b5c0f-ca3e-11e3-abb8-00ff29e41420

Extends

Implements

  • Instance Class
  • Web Controller

Content Type Fields

  • Title
  • Identifier
  • Package
  • Summary
  • Icon
  • Class Name

Model Properties

  •  

Example

<?php
namespace com_presidentsdemo_www;

use com_webcomand\models\WebCOMANDApp;
use com_webcomand\components\cpath_view;

class presidents_app extends WebCOMANDApp {
    public function launch($options = []) {
        // populate LeftViewContainer with all presidents
        $this->add_component('\com_webcomand\components\cpath_view', [
                'Container' => 'LeftViewContainer',
                'Identifier' => 'list',
                cpath_view::CPATH => '[:President]'
        ]);

        // populate CenterViewContainer with first president
        $this->add_component('\com_webcomand\components\cpath_view', [
             'Container' => 'CenterViewContainer',
             'Identifier' => 'form',
             // link this view to the list above with:
             cpath_view::PARENT_IDENTIFIER => ['list'],
             // display first president initially
             cpath_view::CPATH => '[:President AND Number=1]'
        ]);
    }
}