Coder Social home page Coder Social logo

Comments (71)

gsouf avatar gsouf commented on June 9, 2024 4

Actually this is why i'm using twig instead of volt

from phalcon.

Jurigag avatar Jurigag commented on June 9, 2024 4

Obviously to having any progress someone have to work on this, if you have any idea or want to implement this feel free to do PR.

from phalcon.

krazzer avatar krazzer commented on June 9, 2024 3

This is the only reason I use Twig instead of Volt. Fixing this would be awesome, I would switch back to Volt right away.

from phalcon.

datanator avatar datanator commented on June 9, 2024 2

True inheritance implies that it should be possible to inherit not only one level deep but infinite levels deep. This enables writing templates that complete parent templates or even only partially complete parent templates. It is a great feature for template inheritance such as implemented by Twig and Smarty3. To make inheritance work you need to have multiple nested levels and Volt just does not provide that.

That said: you can make up any template with Volt, and use one level deep inheritance, but multilevel inheritance is much more friendly for maintaining your site.

Think for example of a page inheriting from a template that holds the site wide main menu which in it's turn inherits from an empty page which in turn inherits from a bootstrap template. When your Bootstrap version changes there is only one point where you need to make changes and every page in your site now uses your new Bootstrap version.

That said, in current web designs, Ajax and Angular like technologies pretty much obviates the need for many levels of inheritance... though true inheritance still is a very elegant way to build your site.

from phalcon.

NZX-DeSiGN avatar NZX-DeSiGN commented on June 9, 2024 1

+1 hope it will be released soon !

from phalcon.

vladimmi avatar vladimmi commented on June 9, 2024 1

Just retire to using Twig if you have no skills to implement this feature yourself for Volt. It was planned for 1.3 milestone, then removed and promised for Phalcon 2 with Zephir, then moved again, now planned for 4.0 milestone... After all, it wasnt done for more than 4 years now, so I believe can be assumed as low-priority.

from phalcon.

datanator avatar datanator commented on June 9, 2024 1

I have been reverting to Smarty which might be older than Twig but has a better speed benchmark as far as I read. I think they are both a good choice.

However, a template engine comparable to Twig or Smarty with full support for nested blocks or even better: template inheritance would be the only reason to use Phalcons Volt engine. There is a lot to say to implement Smarty or Twig in Zephir.

Though I realize this thread is not the platform, I am strongly in favour of splitting Phalcon into different PHP modules, and a template engine might be a good candidate to build into an autonomous module.

from phalcon.

vladimmi avatar vladimmi commented on June 9, 2024 1

Well, probably some benchmarks needed to show whether there is some significant perfomance difference between Volt and Twig. Also, talking under the issue of unsupported block nesting, faster isn't always better if it's not enough flexible.

from phalcon.

datanator avatar datanator commented on June 9, 2024 1

I would suggest to reads jurijags reply again. Use either Twig or Smarty3 in stead of Volt, it might be slower in compilation time (when the template changes) but it won't matter in execution time (when the template is rendered).
I dismissed many of Phalcons features, but still use the framework basis since it is a fast and clean one.

from phalcon.

gianks avatar gianks commented on June 9, 2024 1

from phalcon.

niden avatar niden commented on June 9, 2024 1

This has all been outlined in our blog (https://blog.phalcon.io).

  • v5 is the extension. It will remain as such.
  • v6 will be rewritten in PHP. Additionally benchmarks will be created for this version to identify slow areas of the code. Those areas will be also written in Zephir and will be offered as an extension. So you can install Phalcon with composer but if you want additional boost, you can also install the extension for v6.

from phalcon.

vladimmi avatar vladimmi commented on June 9, 2024 1

Stale bots are the plague of GitHub making any inactivity a sign of "everything is great now" and closing unresolved issues...

from phalcon.

niden avatar niden commented on June 9, 2024 1

Stale bots are the plague of GitHub making any inactivity a sign of "everything is great now" and closing unresolved issues...

Yeah, after today I am considering deactivating it. I had to remove the stale label from over 20 issues so far :/

from phalcon.

xpundel avatar xpundel commented on June 9, 2024

The same question. Is there a plans to implement this feature?

from phalcon.

xpundel avatar xpundel commented on June 9, 2024

Greetings!
Is there any plans to implement this feature?

from phalcon.

breezewish avatar breezewish commented on June 9, 2024

Hi, is there any plans? I think this feature is important.

from phalcon.

gianks avatar gianks commented on June 9, 2024

+1

from phalcon.

gsouf avatar gsouf commented on June 9, 2024

I upvote for the feature

from phalcon.

Raistlfiren avatar Raistlfiren commented on June 9, 2024

Agreed. It would be nice to have a block inside an if statement.

from phalcon.

kvokov avatar kvokov commented on June 9, 2024

I think it's very useful feature. Waiting for this!

from phalcon.

raisoblast avatar raisoblast commented on June 9, 2024

+1 for this great feature

from phalcon.

vladimmi avatar vladimmi commented on June 9, 2024

Any improvements after almost a year? As for me, this is the most needed missing feature in Volt

from phalcon.

 avatar commented on June 9, 2024

This will be implemented in Phalcon 2 with Zephir

from phalcon.

redstrike avatar redstrike commented on June 9, 2024

At this moment, Phalcon 2 is missing some features from 1.x and still not stable enough for using in production. Why don't you fix this bug in Phalcon 1.3.3?

from phalcon.

immortalx avatar immortalx commented on June 9, 2024

+1 to implement this feature in 1.3.x

from phalcon.

vladimmi avatar vladimmi commented on June 9, 2024

It seems, developers are focused only on 2.x branch and will not implement any new features in 1.3. Anyway, this wasn't implemented for 1.5 years so... You can use Twig if you need this feature.

from phalcon.

gsouf avatar gsouf commented on June 9, 2024

@phalcon told

This will be implemented in Phalcon 2 with Zephir

from phalcon.

manish-ga avatar manish-ga commented on June 9, 2024

Just curious, when will Phalcon 2 be released?

from phalcon.

datanator avatar datanator commented on June 9, 2024

So the reason not to use Twig or Smarty is that I suppose Volt is considerably faster in compiling templates since I suppose that the engine is written in C. And it seems that the compiled code is pretty clean too...
However, template inheritance screams for nested blocks... you can hardly live without these.
Plus One for nested blocks (and verbatim and block-plugins)

from phalcon.

gsouf avatar gsouf commented on June 9, 2024

And i use twig because I assume that the template are cached once they are parsed ;)

from phalcon.

michanismus avatar michanismus commented on June 9, 2024

+1 We need it so bad!

from phalcon.

redstrike avatar redstrike commented on June 9, 2024

I have moved to Twig completely for rendering templates. It's more mature and has better docs.

from phalcon.

AGvin avatar AGvin commented on June 9, 2024

Hi guys, do we have some updates for this feature?

from phalcon.

reedgz avatar reedgz commented on June 9, 2024

phalcon commented on Jan 14, 2014
This will be implemented in Phalcon 2 with Zephir

Any news on this one? Definitely needed.

I am developing current project with volt, just ran into the problem. Now I have to decide if I want to re-write all views in twig/smarty. Only two weeks from the deadline now.

from phalcon.

andresgutierrez avatar andresgutierrez commented on June 9, 2024

@reedgz I'll be addressing this soon

from phalcon.

reedgz avatar reedgz commented on June 9, 2024

@andresgutierrez Thanks man. I am still developing with volt; just used some include to work around the problem. Fortunately my views are relatively simple.

from phalcon.

ilyavaiser avatar ilyavaiser commented on June 9, 2024

Nothing at all?

from phalcon.

michanismus avatar michanismus commented on June 9, 2024

I switched to Twig as well...

from phalcon.

redstrike avatar redstrike commented on June 9, 2024

I wonder why Phalcon team created VOLT, which causes a lot of troubles for framework users. Twig's mature and performance are too great (templates are compiled to php, then it will be cached by Zend Opcache + add-on Twig C extension).

What happens if Phalcon team drops Volt to improve project's development speed?

from phalcon.

andresgutierrez avatar andresgutierrez commented on June 9, 2024

@redstrike "A LOT OF TROUBLES" "TOO GREAT"

from phalcon.

alejandrovasta avatar alejandrovasta commented on June 9, 2024

I need this feature as soon as possible! please, it's a shame that this magnificent framework doesn't have something so important. Thanks

from phalcon.

valVk avatar valVk commented on June 9, 2024

up

from phalcon.

tyurderi avatar tyurderi commented on June 9, 2024

Can't we work with Twig until its implemented? Need this indeed.

from phalcon.

valVk avatar valVk commented on June 9, 2024

yes, Twig our saver but it's not a good solution at all ((

from phalcon.

angelxmoreno avatar angelxmoreno commented on June 9, 2024

Could the need for nested blocks be solved by using nested partials?

from phalcon.

tobispace avatar tobispace commented on June 9, 2024

+1

from phalcon.

mikhail-radomskii avatar mikhail-radomskii commented on June 9, 2024

+1

from phalcon.

kim-dam-groenhoej avatar kim-dam-groenhoej commented on June 9, 2024

Still no progress?
+1

from phalcon.

kim-dam-groenhoej avatar kim-dam-groenhoej commented on June 9, 2024

Witch files do I have to look on?

from phalcon.

sergeyklay avatar sergeyklay commented on June 9, 2024

https://github.com/phalcon/cphalcon/tree/master/phalcon/mvc/view/engine

from phalcon.

SimBioT1954 avatar SimBioT1954 commented on June 9, 2024

Still waiting for this feature !

from phalcon.

m4tm4t avatar m4tm4t commented on June 9, 2024

Some news about nested blocks?

from phalcon.

kornerita avatar kornerita commented on June 9, 2024

+1 to this feature

from phalcon.

sm0nster avatar sm0nster commented on June 9, 2024

+1 to this feature

from phalcon.

Jurigag avatar Jurigag commented on June 9, 2024

Since on production volt templates are translated to plain php anyway so there is no really any performance if little gain we could rewrite template engine to plain php anyway. Sure it will be much slower on developing but easier to implement things because right now except zephir alone which is not really a problem you need to edit c files to implement this feature.

from phalcon.

datanator avatar datanator commented on June 9, 2024

I think you are right @Jurigag, but it sort of obviates the need for Volt alltogether since better template engines are out there... Some runtime template engine features might offer some performance gain when implemented in Zephir/C, but since modern web development focuses on client side templating this will also will not be worth the effort...
Like Symphony, Phalcon should promote third party products such as Twig, Smarty, Doctrine etc.

from phalcon.

Jurigag avatar Jurigag commented on June 9, 2024

Maybe there are but not twig - twig is not plain php - it's still using many classes. Making it much slower than blade or volt. I think blade on final form compiles to truly plain php - making it really fast.

from phalcon.

vladimmi avatar vladimmi commented on June 9, 2024

How does using classes make PHP not plain? I can be wrong but Volt and Twig are very similar both in terms of used syntax for templates and by outputting template translated into php code.

from phalcon.

Jurigag avatar Jurigag commented on June 9, 2024

By using objects, you don't need objects to render html. Each block in twig is an object which just slow down whole thing. This is why blade/volt is faster.

from phalcon.

hdjvieira avatar hdjvieira commented on June 9, 2024

+1

from phalcon.

valVk avatar valVk commented on June 9, 2024

One of the most commented feature in this milestone and in the same time in the end of TODO list )

from phalcon.

4ctarus avatar 4ctarus commented on June 9, 2024

+1

from phalcon.

victorhramos avatar victorhramos commented on June 9, 2024

Im giving up using Volt cause that feature, in large and complex templates is very painful maintain using only one level of inheritance. Using phalcon only in API for Vue front.

from phalcon.

Jurigag avatar Jurigag commented on June 9, 2024

No twig or smarty3, only blade - twig and smarty3 are not really plain php - for each blocks etc they steal are using many objects and classes for no reason. Blade is pretty much similar in speed as volt on cached views.

from phalcon.

datanator avatar datanator commented on June 9, 2024

Don't know Blade too well but does it support infinite inheritance? From the examples I only see one level, similar to Volt. I agree with Jurigag that Smarty and to a lesser extent Twig is somewhat bloated, but one might like the modular and extensible nature of that. In the end the compiled template defines most of its speed and efficiency. It boils down to a matter of taste. We can agree that Volt still has to improve to compete...

from phalcon.

ug-code avatar ug-code commented on June 9, 2024

+1
it's very useful feature.
actually "Laravel blade" is more useful than "volt"
see also => "yield, section"

from phalcon.

erickmajor avatar erickmajor commented on June 9, 2024

@niden

In version 4.0 of Phalcon it will be possible to use blocks {% block %} under conditions {% if %} and {% else %}?

from phalcon.

niden avatar niden commented on June 9, 2024

Closing in favor of phalcon/cphalcon#13855. Will revisit if the community votes for it, or in later versions.

from phalcon.

gianks avatar gianks commented on June 9, 2024

Is there a deadline for this feature or will it be postponed forever?

from phalcon.

niden avatar niden commented on June 9, 2024

This will be addressed when we start working on v6 which will be the PHP version of Phalcon. There is no deadline as of yet and it has not been abandoned. Once v5 is out and stable we will start working on v6

from phalcon.

Jeckerson avatar Jeckerson commented on June 9, 2024

@gianks Please read this blog post - https://blog.phalcon.io/post/phalcon-roadmap

from phalcon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.