LiveWhale CMS

Welcome, Guest Login

Support Center

Our documentation is moving: docs.livewhale.com

Please check docs.livewhale.com for the most up-to-date LiveWhale CMS and LiveWhale Calendar documentation. The below legacy documentation will remain available as a reference until the documentation migration is complete.

Module Naming

Last Updated: Jun 26, 2014 07:30AM PDT
When developing modules, you’ll want to make sure that the name you choose matches with what LiveWhale expects, so that all the pieces are loaded properly. An example is below, but if key pieces are based on the name “My Module,” they would appear as follows:
  1. In the client/modules folder the enclosing folder would be:
    /my_module
  2. The files within the /my_module folder would be (examples):
    public.application.my_module.php
    private.data.my_module.php
    public.widget.my_module.php
  3. In each of the files, there should be a leading reference to append the module to the proper registered scope:
    $_LW->REGISTERED_APPS['my_module'] = ...
    $_LW->REGISTERED_WIDGETS['my_module'] = ...
  4. In the same file, there should be a matching class, using a camelCased version of the name:
    class LiveWhaleApplicationMyModule { ...
    class LiveWhaleWidgetMyModule { ...
  5. Within that class, there should be public methods matching any handlers you intend to use, but all other methods or properties are then open, as they are limited to your class alone. You may include/require other classes as desired, but avoid calling the same class twice (for obvious reasons). Do not call one module from another.
Here is an example with a notification module:
// in clients/modules/public_notifier/public.application.public_notifier.php
 
$_LW->REGISTERED_APPS['public_notifier']=array(
     'title'=>'Public Submission Notifier',
      ...
      'handlers' => array('onAfterPublicSubmission')
);


class LiveWhaleApplicationPublicNotifier {
     ...
    public function onAfterPublicSubmission () {
        ...
    }
    ...
}




​Expertise Needed: Developer

Software: LiveWhale CMS, LiveWhale One, LiveWhale Calendar

Version Applicability: Current

SFTP Access Required? Yes

eb8f96c071020d8b0923da726d6cab65@livewhale.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete?b_id=4256