GithubHelp home page GithubHelp logo

Comments (10)

tacone avatar tacone commented on August 25, 2024

looks like the twig syntax

from rapyd-laravel.

tacone avatar tacone commented on August 25, 2024

Also check this out: http://symfony.com/doc/current/components/expression_language/introduction.html (php >= 5.5.3, no dependencies)
(though I'm not sure it supports piping filters like in your examples above)

from rapyd-laravel.

zofe avatar zofe commented on August 25, 2024

looks really interesting, especially the way you can define/create expressions http://symfony.com/doc/current/components/expression_language/extending.html
however I have little time available.. so I think I'll start from a simple method that fit my needs
then we can do something better

from rapyd-laravel.

tacone avatar tacone commented on August 25, 2024

just throw Twig back in. Twig is your friend.

from rapyd-laravel.

zofe avatar zofe commented on August 25, 2024

I love twig, but.. then:

  • I must rearrange dg to support twig instread blade,
  • then I need to find a way to let users define custom filters/functions
  • then we should rewrite widgets views (just to uniform syntax)
  • then if we use twig bridge.. how to share configuration bw application ... package..

from rapyd-laravel.

zofe avatar zofe commented on August 25, 2024

this should be done https://github.com/zofe/rapyd-laravel/blob/master/src/Zofe/Rapyd/DataGrid/Cell.php#L38

 $grid->add('author.name', 'Body')->filter('strip_tags|substr[0,20]');

from rapyd-laravel.

tacone avatar tacone commented on August 25, 2024

is the blade syntax still supported?

from rapyd-laravel.

zofe avatar zofe commented on August 25, 2024

absolutely yes, I just added a simple method (similar to "rule" syntax of validator) and probably I'll also add the closure .
I need just to find a convention to support php functions where input-value is not the first .. and to support also static classes.

from rapyd-laravel.

zofe avatar zofe commented on August 25, 2024

also done

$grid->add('body|strip_tags|substr[0,20]','Body');

from rapyd-laravel.

zofe avatar zofe commented on August 25, 2024

also done cell closure.. so now DataGrid support:

$grid->add('body', 'Body')->filter('strip_tags|substr[0,20]');  //filters
$grid->add('body|strip_tags|substr[0,20]','Body');  //inline filters
$grid->add('ucfirst(substr( {{ $body }}, 0,100))', 'Body');  //inline blade

//and closure on value
$grid->add('body', 'Body')->cell( function ($value) {
            return substr(strip_tags($value), 0, 20);
 });

I close this for now.. I think is enough

from rapyd-laravel.

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.