mirror of
https://github.com/jonom/silverstripe-betternavigator.git
synced 2024-10-22 14:05:51 +02:00
Added code to flush on build
Replaced unnecessary references to ?flush=1 and ?flush=all. Added code to enable the build task to also flush.
This commit is contained in:
parent
d85ecaa655
commit
8af231cf7f
@ -8,3 +8,6 @@ LeftAndMain:
|
||||
ContentController:
|
||||
extensions:
|
||||
- BetterNavigator
|
||||
DevelopmentAdmin:
|
||||
extensions:
|
||||
- FlushOnDevBuild
|
14
code/FlushOnDevBuild.php
Executable file
14
code/FlushOnDevBuild.php
Executable file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* via swaiba https://groups.google.com/d/msg/silverstripe-dev/RNWCiFAnRI0/bABhA5Otnl4J
|
||||
*/
|
||||
|
||||
class FlushOnDevBuild extends Extension {
|
||||
function beforeCallActionHandler($request,$action){
|
||||
if(!$this->owner->response->isFinished() && $action=='build' && $request->getVar('flush')){
|
||||
SS_TemplateLoader::instance()->getManifest()->regenerate(true);
|
||||
SSViewer::flush_template_cache();
|
||||
}
|
||||
}
|
||||
}
|
@ -53,8 +53,8 @@
|
||||
<a href="$Link?isDev=1"><span class="bn-icon-devmode"></span>Dev Mode</a>
|
||||
<% end_if %>
|
||||
|
||||
<a href="$Link?flush=all"><span class="bn-icon-flush"></span>Flush Templates</a>
|
||||
<a href="/dev/build/?flush=1" target="_blank"><span class="bn-icon-db"></span>Build Database</a>
|
||||
<a href="$Link?flush"><span class="bn-icon-flush"></span>Flush</a>
|
||||
<a href="/dev/build/" target="_blank"><span class="bn-icon-db"></span>Build & Flush</a>
|
||||
<a href="/dev/" target="_blank"><span class="bn-icon-tools"></span>Dev Menu</a>
|
||||
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user