I am facing a problem to render a template after hitting a specific route.
Let me describe it a bit. I have a template structure like-
templates
|__mytemplate
|__|__index.php
|__|__component.php
|__|__myfile.php
Now from a system
plugin, I want to render just the myfile.php
with its own scripts
and styles
when it hits the route index.php?option=com_ajax&mytemplate=1
.
The myfile.php
is a simple file.
<head>
<jdoc:include type="head" />
</head>
<body class="contentpane">
<jdoc:include type="component" />
</body>
Which I found to render a template file is like-
$doc->render(false, ['template' => 'mytemplate', 'file' => 'myfile.php']);
But the problem is, I don't get in which event is perfect for rendering the Document
and I don't want any template specific styles/scripts. In other words, I just want to parse and render the myfile.php
with its own styles/scripts.
Then which is the best event where I can attach the styles/scripts and render the myfile.php
.