Skip to content

Instantly share code, notes, and snippets.

Created May 11, 2017 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/84db7866b2a186d1635abe7128c41c34 to your computer and use it in GitHub Desktop.
Save anonymous/84db7866b2a186d1635abe7128c41c34 to your computer and use it in GitHub Desktop.
SW Issue
/* -- 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