How to combine site-wide logic/security in header php include?

In other systems I’ve worked with, I have been able to add lots of “site-wide” logic into an include so it’s used on all pages and only requires editing in one place – the include.

The issue I’m finding with Wappler is that the includes do not easily allow you to add things like the code below since it’s above the opening HTML tag. I want this in my header, but if I’m using routing then Wappler is adding an ac:route in the <head>.

Is there a way to make the route dynamic?
Is there a way to make the other meta tags (e.g.e og:description) dynamic too?

If there is, then I could make an include for all of it and make my sites quicker to build and easier to maintain.

<?php
require('dmxConnectLib/dmxConnect.php');

$app = new \lib\App();

$app->exec(<<<'JSON'
{
	"steps": [
		"Connections/videdit_db_dev",
		"SecurityProviders/siteSecurity",
		{
			"module": "auth",
			"action": "restrict",
			"options": {"loginUrl":"signin","forbiddenUrl":"signin","provider":"siteSecurity"}
		}
	]
}
JSON
, TRUE);
?>
Community Page
Last updated: