有什么方法可以将静态页面的额外字段中的值提取到某个组件中?
我需要它来实现 AJAX 处理程序......
我可以加载静态页面内容,但我需要获取用户设置的属性...
我需要一些代码示例...我可以将静态页面内容加载为Partial
#noobhacks :)
public function onOpenHome()
{
$this->page['categories'] = Category::all();
return [
//'main' => $this->renderPartial('home'),
'main' => $this->renderPartial('../content/static-pages/index'),
'.home_categories' => $this->renderPartial('work_list_categories_post')
];
}
或作为内容:
[viewBag]
==
<main class="home_container" __color="{{ color }}">
<section class="box">
{% content '/static-pages/index.htm' %} <!-- <<<<------ -->
{{ content |raw }}
</section>
</main>
但我不知道如何访问颜色选择器的属性color