cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

Feature Request - Partial vs Include based on environment

Open thepatron opened this issue 11 years ago • 2 comments

Hi,

Per this documentation, there is better performance for include vs. partial. It'd be nice to be able to use partial in debug / test environments and include in production without doing something like the following everywhere in the code...

{% if devEnv == 'prod' %}
  {% include "partials/footer.volt" %}
{% else %}
  {{ partial("partials/footer") }}
{% endif %}

To something like the following which would do the above in one line. I messed around with trying to add a function to volt to do this, but I couldn't figure out how to reproduce include properly.

{{ envPartial("partials/footer") }} 

Thoughts?

Thanks

thepatron avatar Sep 30 '15 17:09 thepatron

Interesting ! I would very much like to see such a feature as well. Do we know how much impact using partial has on performances ?

feloot avatar May 15 '16 10:05 feloot

Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues

stale[bot] avatar Apr 17 '18 00:04 stale[bot]