¡@

Home 

php Programming Glossary: twig

How to include CSS file in Symfony 2 and Twig?

http://stackoverflow.com/questions/12165485/how-to-include-css-file-in-symfony-2-and-twig

I have HomeController with indexAction that renders a twig template file public function indexAction return this render.. return this render WebsHomeBundle Home index.html.twig So this is easy. Now what I want to do is to include some CSS.. them Should I configure something else php symfony2 twig share improve this question You are doing everything right..

Decoding JSON in Twig

http://stackoverflow.com/questions/14500698/decoding-json-in-twig

JSON in Twig Is is possible to decode JSON in twig Googling doesn't seem to yield anything about this. Does decoding.. obj category.vars.label json_decode endfor php symfony2 twig share improve this question Thats easy if you extend twig.. share improve this question Thats easy if you extend twig . First create a class that will contain the extension php namespace..

How to check for null in Twig?

http://stackoverflow.com/questions/3264889/how-to-check-for-null-in-twig

to check whether a value is NULL in a Twig template php twig share improve this question Depending on what exactly you..

twig - pass function into template

http://stackoverflow.com/questions/3595727/twig-pass-function-into-template

pass function into template Currently I place my function in.. to do like below blah Is it possible php template engine twig share improve this question In short no this is not possible... return date format_string strtotime date_string twig_env addFilter 'format_date' new Twig_Filter_Function 'format_date'..

Twig forgets array-keys

http://stackoverflow.com/questions/6197499/twig-forgets-array-keys

forgets array keys I have a weird problem with twig in Symfony2. I am using the following array days Array 1 Array.. 6 but it should look like this 1 2 3 4 18 19 31 Looks like twig creates a new array with new indexes. Is there a way to get.. php I can see the right index so the problem is related to twig. php arrays symfony2 twig share improve this question also..

Symfony 2 load different template depending on user agent properties

http://stackoverflow.com/questions/8257676/symfony-2-load-different-template-depending-on-user-agent-properties

return this render 'AcmeBlogBundle Blog index.'. format.'.twig' But can it be done globally Like a service or something that.. make changes in the templating rules. php mobile symfony2 twig share improve this question Ok so I don't have a full solution.. validation enable_annotations true templating engines twig loaders moby.loader default_locale locale trust_proxy_headers..

Accessing session from TWIG template

http://stackoverflow.com/questions/8399389/accessing-session-from-twig-template

not exist . What I'm doing wrong php session symfony2 twig share improve this question app.session refers to the Session.. you attribute in the session and retrieve the value in you twig template by using the Session object. In a controller session..

Path of assets in CSS files in Symfony2

http://stackoverflow.com/questions/9500573/path-of-assets-in-css-files-in-symfony2

is still wrong url .. .. .. web images myimage.png The twig code of Assetic stylesheets '@MyCompanyMyBundle Resources assets.. public dir Resources public images devil.png Willing that twig takes that css recompiles it into web css a.css and make it.. css . This gave me a total of 14 combinations on the same twig and this route was launched from app_dev.php app.php and thus..

How can I echo HTML in PHP?

http://stackoverflow.com/questions/1100354/how-can-i-echo-html-in-php

. There are other template engines such as Smarty Twig etc. that make the syntax even more concise e.g. someVariable..

How to include CSS file in Symfony 2 and Twig?

http://stackoverflow.com/questions/12165485/how-to-include-css-file-in-symfony-2-and-twig

to include CSS file in Symfony 2 and Twig Im playing around with Symfony 2 and i have problems including.. 2 and i have problems including CSS and JS files in Twig template. I have a bundle named Webs HomeBundle. Inslide I have.. want to do is to include some CSS and JS files inside this Twig template. Template looks like this DOCTYPE html html head block..

Decoding JSON in Twig

http://stackoverflow.com/questions/14500698/decoding-json-in-twig

JSON in Twig Is is possible to decode JSON in twig Googling doesn't seem.. seem to yield anything about this. Does decoding JSON in Twig not make sense I'm trying to access 2 entity properties on an.. 'json' ... Afterwards I was hoping to json_decode it in Twig... for category in form.categories # json_decode part is imaginary..

How to check for null in Twig?

http://stackoverflow.com/questions/3264889/how-to-check-for-null-in-twig

to check for null in Twig What construct should I use to check whether a value is NULL.. should I use to check whether a value is NULL in a Twig template php twig share improve this question Depending..

twig - pass function into template

http://stackoverflow.com/questions/3595727/twig-pass-function-into-template

strtotime date_string twig_env addFilter 'format_date' new Twig_Filter_Function 'format_date' # in your template # some_date.. 'yes' 'checkbox' Why The thing to remember is that Twig templates represent a view in terms of MVC. This means they..

Twig forgets array-keys

http://stackoverflow.com/questions/6197499/twig-forgets-array-keys

forgets array keys I have a weird problem with twig in Symfony2...

Symfony2 conceptual issue: general bundles vs. specific ones

http://stackoverflow.com/questions/8012191/symfony2-conceptual-issue-general-bundles-vs-specific-ones

on its complexity it could be just a template a macro or a Twig extension . Pagination is a common problem so I suggest you..

Symfony 2 load different template depending on user agent properties

http://stackoverflow.com/questions/8257676/symfony-2-load-different-template-depending-on-user-agent-properties

loader service services moby.loader class Acme AppBundle Twig Loader MobyFilesystemLoader arguments @templating.locator @service_container.. define your loader service class namespace Acme AppBundle Twig Loader use Symfony Bundle FrameworkBundle Templating Loader..

Accessing session from TWIG template

http://stackoverflow.com/questions/8399389/accessing-session-from-twig-template

array is accessible unless you explicitly pass it to every Twig template or if you do an extension that make it available. Symfony2.. 'session' session set 'filter' array 'accounts' 'value' In Twig set filter app.session.get 'filter' set account filter filter..