Giter VIP home page Giter VIP logo

twig.js's Introduction

Twig.js

[Build Badge] Build Status [Scrutinizer Badge] Scrutinizer Code Quality

Twig.js is a PHP project that compiles Twig templates into executable Javascript for client-side execution. It is not to be confused with Twig.js, which is a pure Javascript implementation of the Twig templating language.

Twig Compatibility

Compatibility with vanilla PHP Twig is not yet at 100%. If you need your templates to work with both Twig.js and Twig, stick to the supported filters and functions described below.

Supported Filters

  • abs
  • batch
  • capitalize
  • default
  • e
  • escape
  • first
  • join
  • json_encode
  • keys
  • last
  • length
  • lower
  • merge
  • nl2br
  • raw
  • replace
  • reverse
  • title
  • trim
  • upper
  • url_encode

Supported Functions

  • block
  • include
  • max
  • min
  • random
  • range

Incompatibilities

The following is a list of functionality present in Twig that is not yet available in Twig.js. There are some really easy pickings in these lists for anybody hoping to make a contribution to the project.

Unsupported Filters

  • convert_encoding
  • date (See pull request #11)
  • date_modify
  • format
  • number_format
  • round
  • slice
  • sort
  • split
  • striptags

Unsupported Functions

  • attribute
  • constant
  • cycle
  • date (See pull request #11)
  • dump
  • parent
  • source
  • template_from_string

Testing

To run the tests, you'll need Composer, Node and NPM on your system.

$ make test

License

Twig.js is released under the Apache License, Version 2.0.

twig.js's People

Contributors

henrycatalinismith avatar schmittjoh avatar jonathaningram avatar fran6co avatar julesbou avatar kimlai avatar josiah avatar jeremyfreeagent avatar br0wn avatar stefk avatar anod avatar fduch avatar

Watchers

James Cloos avatar

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.