You should use this setting. Of course, you can make styles be included in your view, and not in your controller. You canβt give a better answer without knowing the settings.
In your controller
$styles_for_layout = array();
$scripts_for_layout = array();
$scripts_for_layout[] = 'script_for_page.js';
$styles_for_layout [] = 'style_for_page.css';
headerp.php
<?php if(!empty($styles_for_layout))?>
<?php foreach ($styles_for_layoutas $style) : ?>
<link rel='stylesheet' href='<?php echo $style ?>'>
<?php endforeach; ?>
<?php endif; ?>
<?php if(!empty($scripts_for_layout))?>
<?php foreach ($scripts_for_layout as $script) : ?>
<script type='text/javascript' src='<?php echo $script ?>'>
<?php endforeach; ?>
<?php endif; ?>
source
share