You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
2.1 KiB
72 lines
2.1 KiB
<?php |
|
|
|
/** |
|
* Copyright (C) 2018 Amiel Elboim <amielel@matrix.co.il> |
|
* |
|
* LICENSE: This program is free software; you can redistribute it and/or |
|
* modify it under the terms of the GNU General Public License |
|
* as published by the Free Software Foundation; either version 3 |
|
* of the License, or (at your option) any later version. |
|
* This program is distributed in the hope that it will be useful, |
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
* GNU General Public License for more details. |
|
* You should have received a copy of the GNU General Public License |
|
* along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;. |
|
* |
|
* @package OpenEMR |
|
* @author Amiel Elboim <amielel@matrix.co.il> |
|
* @link http://www.open-emr.org |
|
*/ |
|
|
|
namespace PrescriptionTemplates; |
|
|
|
use Laminas\ModuleManager\ModuleManager; |
|
|
|
/** |
|
* The default module configurator |
|
* |
|
* @author suleymanmelikoglu |
|
*/ |
|
class Module |
|
{ |
|
/** |
|
* the implementation of the autoloader provider, |
|
* returns an array for the AutoloaderFactory |
|
*/ |
|
public function getAutoloaderConfig() |
|
{ |
|
return array( |
|
'Laminas\Loader\ClassMapAutoloader' => array( |
|
__DIR__ . '/autoload_classmap.php', |
|
), |
|
'Laminas\Loader\StandardAutoloader' => array( |
|
'namespaces' => array( |
|
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, |
|
|
|
), |
|
), |
|
); |
|
} |
|
|
|
public function getConfig() |
|
{ |
|
return include __DIR__ . '/config/module.config.php'; |
|
} |
|
|
|
/** |
|
* load global variables foe every controllers |
|
* @param ModuleManager $manager |
|
*/ |
|
public function init(ModuleManager $manager) |
|
{ |
|
$events = $manager->getEventManager(); |
|
$sharedEvents = $events->getSharedManager(); |
|
|
|
$sharedEvents->attach(__NAMESPACE__, 'dispatch', function ($e) { |
|
$controller = $e->getTarget(); |
|
//$controller->layout()->setVariable('status', null); |
|
$controller->layout('PrescriptionTemplate/layout/layout'); |
|
}, 100); |
|
} |
|
}
|
|
|