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.
我希望能够预测何时<jdoc:include type="component" />不返回任何内容。
<jdoc:include type="component" />
像这样的东西:
<?php if( count(<jdoc:include type="component" />)>=1 ) : ?> <jdoc:include type="component" /> <?php else :?> Sorry No Content <?php endif ; ?>
到处搜索,但找不到任何与此相关的内容。抱歉,如果这是补救措施。
我有这个用于测试组件加载错误的代码片段......不确定是否适合你
<?php if ($this->getBuffer('message')) : ?> <div class="error"> <h2> Message </h2> <jdoc:include type="message" /> </div> <?php endif; ?> <jdoc:include type="component" />
祝你好运!