如何在Opencart中填充$styles数组?

如何在Opencart中填充$styles数组?,opencart,Opencart,我开始使用Opencart,并通过复制默认模板来制作自己的模板 当我浏览template/common/header.tpl时,我看到以下几行 <?php foreach ($styles as $style) { ?> <link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $st

我开始使用Opencart,并通过复制默认模板来制作自己的模板

当我浏览template/common/header.tpl时,我看到以下几行

<?php foreach ($styles as $style) { ?>
<link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>


各种控制器类使用
$this->document->addStyle()
将样式添加到数组中。如果您想查看方法的源代码,请使用各种控制器类使用
$this->document->addStyle()
$this->document>样式添加到数组中,则
$this->document>类位于
/system/library/document.php
中。如果您想查看该方法的源代码,
$this->document
类位于
/system/library/document.php