Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFR]: Volt extends from virable or from absolute path #175

Open
Jeckerson opened this issue Sep 24, 2019 · 7 comments
Open

[NFR]: Volt extends from virable or from absolute path #175

Jeckerson opened this issue Sep 24, 2019 · 7 comments
Assignees

Comments

@Jeckerson
Copy link
Member

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 %}
  3. {% extends "/var/absolute/path/to/layout" %}
@Jeckerson Jeckerson changed the title [NFR]: Volt extends from virable, absolute path [NFR]: Volt extends from virable or from absolute path Sep 25, 2019
@phalcon phalcon deleted a comment from stale bot Dec 24, 2019
@yassinrais
Copy link

yassinrais commented Feb 5, 2020

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.

@Jeckerson
Copy link
Member Author

@yassinrais Give your vote in this issue - phalcon/cphalcon#14608

@Jeckerson Jeckerson self-assigned this Sep 30, 2020
@AliShareei
Copy link

AliShareei commented Feb 8, 2021

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 phalcon/cphalcon#14608

@Jeckerson
Copy link
Member Author

@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.

@AliShareei
Copy link

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?

@Jeckerson
Copy link
Member Author

@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 #90 (comment) - in future it might be used outside of Phalcon eco-system as independent package

@niden niden transferred this issue from phalcon/cphalcon Oct 1, 2021
@stale stale bot added the stale Stale issue scheduled to be deleted label Apr 20, 2022
@phalcon phalcon deleted a comment from stale bot Apr 20, 2022
@stale stale bot removed the stale Stale issue scheduled to be deleted label Apr 20, 2022
@AliShareei
Copy link

Hello guys,
Do you think we have any chance for this in V5?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Phalcon Roadmap
  
Backlog
Development

No branches or pull requests

3 participants