Simplest: load CSS in boot()
This commit is contained in:
@@ -8,7 +8,6 @@ use OCP\AppFramework\App;
|
|||||||
use OCP\AppFramework\Bootstrap\IBootContext;
|
use OCP\AppFramework\Bootstrap\IBootContext;
|
||||||
use OCP\AppFramework\Bootstrap\IBootstrap;
|
use OCP\AppFramework\Bootstrap\IBootstrap;
|
||||||
use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
||||||
use OCP\AppFramework\Http\TemplateResponse;
|
|
||||||
use OCP\Util;
|
use OCP\Util;
|
||||||
|
|
||||||
class Application extends App implements IBootstrap {
|
class Application extends App implements IBootstrap {
|
||||||
@@ -20,17 +19,10 @@ class Application extends App implements IBootstrap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function register(IRegistrationContext $context): void {
|
public function register(IRegistrationContext $context): void {
|
||||||
// Register event listener - this fires on EVERY page render after template is built
|
|
||||||
$context->registerEventListener(
|
|
||||||
TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS,
|
|
||||||
function() {
|
|
||||||
Util::addStyle('minimalprofile', 'minimalprofile');
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
file_put_contents('/tmp/minimalprofile.log', date('Y-m-d H:i:s') . ' register, event registered' . "\n", FILE_APPEND);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function boot(IBootContext $context): void {
|
public function boot(IBootContext $context): void {
|
||||||
|
// This is supposed to load on every page
|
||||||
|
Util::addStyle('minimalprofile', 'minimalprofile');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user