문제

Does this function views_get_current_view inside views header or footer (to count rows number for example) means running the same view twice?
Or is it somewhat simplified version of running full view? Thank you.

도움이 되었습니까?

해결책

That function is just a wrapper for this function: https://api.drupal.org/api/views/views.module/function/views_set_current_view/7.x-3.x which will just return a reference to a static code cache.

Conclusion: no view gets run, it's just grabbing a copy of what's already been created.

In general, views is very efficient in such cases.

But I'd tend to agree with @berramou that you might have a better way of accomplishing what you really, really want.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 drupal.stackexchange
scroll top