Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个模块并将其分配给自定义布局(路线 - 产品/类别)。在此页面中,我只需要显示模块内容。
那么有什么方法可以检查模块是否分配给当前布局?
像下面的东西,
if ($current module = "Product_list") { // Dont display products } else { // Else display products }
如果您将其编码到模块代码本身中,您只需要检查当前路线
if(!empty($this->request->get['route']) && $this->request->get['route'] == 'product/category') { ... Code ... } else { ... Code ... }