Coder Social home page Coder Social logo

[NFR] Volt output filters about phalcon HOT 10 OPEN

scento avatar scento commented on May 31, 2024 2
[NFR] Volt output filters

from phalcon.

Comments (10)

scento avatar scento commented on May 31, 2024

As I just found out, this is NFR covers already expressed ideas (#1924 or phalcon/cphalcon#2182).

from phalcon.

ruudboon avatar ruudboon commented on May 31, 2024

Maybe a tag could also work. Sometimes it can be handy not filter all the content

{{strip}}
<!DOCTYPE html>
<html>
    <head>
        <title>{{ title }} - An example blog</title>
    </head>
    <body>
      <h1>test</h1>
    </body>
</html>
{{endstrip}}

from phalcon.

ruudboon avatar ruudboon commented on May 31, 2024

Any updates regarding this NFR? If nothing is done yet I would like to give it a try using the incubator.

from phalcon.

JABirchall avatar JABirchall commented on May 31, 2024

I am commenting on this to express interest in this feature, today I've been searching for a way to cache compiled minified views.

from phalcon.

Jurigag avatar Jurigag commented on May 31, 2024

@JABirchall just use {% cache %} {% endache %} i guess @JABirchall not sure about this minifing, i guess you mean this mostly.

from phalcon.

JABirchall avatar JABirchall commented on May 31, 2024

@Jurigag I know about the fragment caching. But I'm more interested in having phalcon minify views before caching.

I use {% cache %} alot actually, since most of the data on my site is from a remote API/Socket. If we had a {% minify %} tag would be nice.

from phalcon.

Jurigag avatar Jurigag commented on May 31, 2024

Then you can actually implement your own Frontend class i think and remove any whitespaces there since {% cache %} uses just normal backend class and frontend class. Phalcon\Cache\FrontendInterface

It should be similar as https://github.com/phalcon/cphalcon/blob/master/phalcon/cache/frontend/output.zep just add your logic for minification in beforeStore.

from phalcon.

Jurigag avatar Jurigag commented on May 31, 2024

Well what i propose is workaround of course for now, some way to do this directly in view could be good.

from phalcon.

JABirchall avatar JABirchall commented on May 31, 2024

Well what i propose is workaround of course for now, some way to do this directly in view could be good.

Yeah, I'd be more interested in it being an official feature. Anything to speed up the framework more.

Could add an optional option in volt to enable magnification for all views useful for production environments where changes are not likely to happen often. and the {% minify %} {% endminify %} blocks for optional minifications.

I personally don't like the idea of this proposal proposing it to be a separate filter that you need to add in the service loader. It should be in the volt engine where you can just enable it or use the blocks.

from phalcon.

niden avatar niden commented on May 31, 2024

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

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.