-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Smarty and Twig template engines #3452
base: develop
Are you sure you want to change the base?
Conversation
df6ac87
to
9a1a437
Compare
f0d1b08
to
5d7274a
Compare
'file_exists', | ||
'array_key_exists', | ||
]; | ||
$securityPolicy->secure_dir = [ROOT_PATH . '/custom/templates', ROOT_PATH . '/custom/panel_templates']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm i have a issue as Store module modifies $securityPolicy->secure_dir to view its template files for gateways / connections etc
Now i wont be able to modify $securityPolicy anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you modify securityPolicy currently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gateways work same way as template settings where the template files is stored inside the gateways folder, Like how templates do
So its change the secure dir when gateways page is loaded
$securityPolicy->secure_dir = [ROOT_PATH . '/modules/Store', ROOT_PATH . '/custom/panel_templates'];
|
||
$smarty->setCompileDir(ROOT_PATH . '/cache/templates_c'); | ||
|
||
if ($panelTemplate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded now :S I have a upcoming module and private modules thats adding another dashboard
It should be path instead of Boolean to continue allowing modules to add new dashboards
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does your module initialise a new instance of Template
, with your template files in a custom directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TemplateBase yea, It might still work without using this new way as its still load Smarty directly like how templates used to do
In this case the directory is /custom/dashboard_templates/
*/ | ||
public function __construct(string $template) | ||
{ | ||
$loader = new FilesystemLoader(ROOT_PATH . '/custom/templates/' . $template); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also allow path here if people wanna make panel templates or templates for other module releated dashboards in Twig???
…m smarty security directories
3cbe64b
to
dbedd68
Compare
TODO