Created
May 11, 2017 18:16
-
-
Save anonymous/84db7866b2a186d1635abe7128c41c34 to your computer and use it in GitHub Desktop.
SW Issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -- In Bootstrap.php -- */ | |
public function enable() | |
{ | |
return array( | |
'success' => true, | |
'message' => 'Message here..', | |
'invalidateCache' => array( | |
'backend', | |
'frontend', | |
'config' | |
) | |
); | |
} | |
public function uninstall() | |
{ | |
return array( | |
'success' => true, | |
'message' => 'Message here..', | |
'invalidateCache' => array( | |
'backend', | |
'frontend', | |
'config' | |
) | |
); | |
} | |
public function onStartDispatch(\Enlight_Event_EventArgs $arguments) | |
{ | |
$subscriber = new Subscriber\Backend($this->Path(), $this->assertMinimumVersion('5.2.0')); | |
$this->Application()->Events()->addSubscriber($subscriber); | |
} | |
/* -- In Backend.php -- */ | |
public function onPostDispatchIndex(\Enlight_Event_EventArgs $args) | |
{ | |
/**@var $view Enlight_View_Default*/ | |
$view = $args->getSubject()->View(); | |
// Add template directory | |
$view->addTemplateDir( | |
$this->path . 'Views/' | |
); | |
if ($args->getRequest()->getActionName() === 'index') { | |
$view->extendsTemplate( | |
'backend/index/rlds_extends_index/header.tpl' | |
); | |
} | |
} | |
/* -- In header.tpl -- */ | |
{extends file='backend/index/parent.tpl'} | |
{block name="backend/base/header/css" append} | |
<link rel="stylesheet" type="text/css" href="{link file="backend/_resources/styles/rldsIndex.css"}" /> | |
{/block} | |
{block name="backend/base/header/javascript" append} | |
<script type="text/javascript" src="{link file="backend/_resources/js/rldsIndex.js"}"></script> | |
{/block} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment