Question

I just started to learn how to build a webpage with the Symfony2 framework.

I'm used to use Grunt tasks provided by the Yeoman generator, to handle caching, minifying, concatenating etc.

Now I know, that Symfony has his own solutions too, namely: the asset() helper, and Assetic.

From what I know, the yeoman tasks and the Symfony methods seems to be incompatible.

With the symfony {{ asset('asset-src-path') }} syntax, the yeoman tasks just won't work.

Should I just throw out the whole yeoman thing, and use the Symfony helper functions and filters?

I would prefer yeoman, I'm used to it and I like preprocessing the assets for the prod. site.

Note: I have to use the assetic() helper so I can work with url rewriting.

Was it helpful?

Solution

As far as I can tell, there's no easy way to achieve what I wanted.

Luckily, there's no real reason to wrestle with this problem, since - as I mentioned in my question - Symfony has Assetic, which is a great solution.

Note that I did try out a yeoman+symfony solution in a project, which ultimately worked, but I think it really doesn't worth the effort.

Cheers

OTHER TIPS

Yeoman doesn't do any of the stuff you mention, it's simply a configurable generator. All yeoman does is prompt the developer with a few options and then it just downloads, tweaks than dumps a whole bunch of files to a folder. It's run one time — it's just for scaffolding other tools.

Grunt is a task runner built in Node.js. It's somewhat like yeoman in that it automates repetition but it takes over where yeoman leaves off. Whereas yeoman is run at the start of the project and never run again (generally), grunt is run continuously while you develop. The big difference here is that yeoman's generators and grunts tasks barely touch each other — yeoman isn't built for grunt and vice versa. A yeoman generator may create a nicely configured Gruntfile.js, for instance, but it's up to the developer to augment this Gruntfile.js to suit new needs.

Symfony2 is a web framework written in PHP. You can use yeoman to scaffold a Symofny2 app, and Grunt to do certain tasks (although Symfony2 ships with it's own task-runner, Grunt is excellent at front-end still). Symfony2 is a very rich, dynamic constellation of modules that is geared at dealing with HTTP requests and responses (among other things). You can write a yeoman generator that wires Grunt into Symfony2, or you can use Symfony2's console component to run your tasks.

All three are flexible but they are not interchangeable: they are all concerned with different things.

This applies to your linked question: Yeoman vs UrlRouting

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top