【发布时间】:2020-10-06 11:24:05
【问题描述】:
我需要访问和修改我在其自己的 PHP 部分中部分加载的组件。
通常我在页面中加载组件,我可以在 PHP 部分中使用 $this->page->components['exampleComponent'] 访问它们。
但是当组件被部分加载时,它就不存在了。
我尝试过 onStart 和 onEnd 来测试它是否是由于十月的生命周期,但它们从未添加到页面组件中。
那我该如何访问呢?
description = "Sample Partial"
[someComponent exampleComponent]
code = "header-menu"
==
<?php
function onStart(){
// Need to access partial's component here
$exampleComponent = ???
}
?>
==
【问题讨论】:
标签: octobercms