我尝试使用一个简单的循环,在我的实际代码中这个循环更复杂,我需要break这样的迭代,如:
{% for post in posts %}
{% if post.id == 10 %}
{# break #}
{% endif %}
<h2>{{ post.heading }}</h2>
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
我如何使用的行为,break或continue在枝杈PHP控制结构?