Module.php #1

  • //
  • guest/
  • perforce_software/
  • chronicle/
  • main/
  • library/
  • P4Cms/
  • View/
  • Helper/
  • Module.php
  • View
  • Commits
  • Open Download .zip Download (707 B)
<?php
/**
 * View helper that returns an instance of the named module.
 * 
 * @copyright   2011 Perforce Software. All rights reserved.
 * @license     Please see LICENSE.txt in top-level folder of this distribution.
 * @version     <release>/<patch>
 */
class P4Cms_View_Helper_Module
{
    /**
     * Get an enabled module by name.
     *
     * @param   string  $name   the name of the module to fetch.
     */
    public function module($name)
    {
        $module = P4Cms_Module::fetch($name);
        if (!$module->isEnabled()) {
            throw new P4Cms_Module_Exception(
                "Cannot access $name module. Module is disabled."
            );
        }

        return $module;
    }
}
# Change User Description Committed
#1 16170 perforce_software Move Chronicle files to follow new path scheme for branching.
//guest/perforce_software/chronicle/library/P4Cms/View/Helper/Module.php
#1 8972 Matt Attaway Initial add of the Chronicle source code