Skip to content

[NFR]: Volt extends from absolute path #17269

Closed
Closed

Description

@Jeckerson

Sometimes there are need to extend layout dynamically. Now it is possible to do only with relative path, ex: {% extends "layouts/base" %}.
Related topic from forum - https://forum.phalcon.io/discussion/19331/volt-extends-from-virable

I would like to have possibility to set variable, relative path with ../ and absolute path inside {% extends ? %}
Examples:

  1. {% extends "../another-theme/layouts/base" %}
    2. {% extends $dynamicLayout %}
  2. {% extends "/var/absolute/path/to/layout" %}

Activity

  1. changed the title [-][NFR]: Volt extends from virable, absolute path[/-] [+][NFR]: Volt extends from virable or from absolute path[/+] on Sep 25, 2019
  2. deleted a comment from stale on Dec 24, 2019
  3. yassinrais commented on Feb 5, 2020

    @yassinrais

    we really need this

    DIRNAME == the volt file :: current folder
    {% DIRNAME ~ 'exemple/part4' %}

    At that moment
    you have a lot of partials folders and files & you w tant to change a folder name

    you will need to edit every partial file and change the path ...

    Thanks

    greetings.

  4. Jeckerson commented on Feb 6, 2020

    @Jeckerson
    MemberAuthor

    @yassinrais Give your vote in this issue - #14608

  5. self-assigned this
    on Sep 30, 2020
  6. AliShareei commented on Feb 8, 2021

    @AliShareei

    Hello
    Can't we have this for version 4.x?
    I think this is an important and basic feature.
    I don't know about absolute path but at least simple dynamic variable is good enough for now.
    I had almost decided to use Twig because of this problem.

    Also, There is no post for this issue to vote on issue #14608

  7. Jeckerson commented on Feb 8, 2021

    @Jeckerson
    MemberAuthor

    @AliShareei It will be done in v5 because Volt is written in C. Process of rewrite to PHP native is still in progress, as there are 20+k lines of code in C.

  8. AliShareei commented on Feb 8, 2021

    @AliShareei

    Hi @Jeckerson
    If so, since Twig and Volt seems to have similar syntax, what are the benefits of rewriting Volt in PHP? Why not use the Twig for v5?

  9. Jeckerson commented on Feb 8, 2021

    @Jeckerson
    MemberAuthor

    @AliShareei Hello, benefits are relative from view to view. But if generalize:

    • compatibility with existing projects
    • performance (I almost have no doubts about that, even if it is written in PHP)
    • alternative (PHP templates, Volt, Twig or even Smarty). As mentioned here [NFR]: Refactor Phalcon\Mvc\View\Volt phalcon#90 (comment) - in future it might be used outside of Phalcon eco-system as independent package
  10. transferred this issue fromphalcon/cphalconon Oct 1, 2021
  11. added
    stale
    on Apr 20, 2022
  12. deleted a comment from stale on Apr 20, 2022
  13. removed
    stale
    on Apr 20, 2022
  14. moved this to Backlog in Phalcon v5on Aug 25, 2022
  15. 11 remaining items

  16. added 2 commits that reference this issue on Jul 6, 2026
  17. moved this from Active Sprint to In Progress in Phalcon v5on Jul 6, 2026
  18. added 2 commits that reference this issue on Jul 6, 2026
  19. niden commented on Jul 6, 2026

    @niden
    SponsorMember

    Resolved in #17272

  20. moved this from In Progress to Implemented in Phalcon v5on Jul 6, 2026
  21. added 5 commits that reference this issue on Jul 6, 2026
  22. moved this from Implemented to Released in Phalcon v5on Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

5.0new feature request

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions