Setting Up Symfony Projects: Difference between revisions
No edit summary |
|||
| (5 intermediate revisions by 2 users not shown) | |||
| Line 3: | Line 3: | ||
Notes on tasks related to setting up web projects using the [http://symfony.com/doc/current/index.html Symfony] framework. | Notes on tasks related to setting up web projects using the [http://symfony.com/doc/current/index.html Symfony] framework. | ||
== Resource | == Resource locations == | ||
* '''Controllers:''' `src/AppBundle/Controller/` | * '''Controllers:''' `src/AppBundle/Controller/` | ||
* '''Models''' (Entities): `src/AppBundle/Entity/` | * '''Models''' (Entities): `src/AppBundle/Entity/` | ||
* '''Templates:''' `app/Resources/views/` | * '''Templates:''' `app/Resources/views/` | ||
* '''Sass:''' | * '''Sass:''' `app/Resources/assets/` | ||
* '''Stylesheets:''' '' | * '''Stylesheets:''' | ||
* '''Images:''' | ** With Assetic: `src/AppBundle/Resources/public/sass/` ''< (?)'' | ||
* '''JavaScript:''' '' | ** Without Assetic" `web/css/` | ||
* '''Images:''' | |||
** With Assetic: `src/AppBundle/Resources/public/images/` | |||
** Without Assetic" `web/images/` | |||
* '''JavaScript:''' | |||
** With Assetic: `src/AppBundle/Resources/public/js/` | |||
** Without Assetic" `web/js/` | |||
''With the Assetic paths, `src\AppBundle\` is the location of the default app bundle, use whatever is appropriate for other bundles.'' | |||
== Templates == | == Templates == | ||
| Line 37: | Line 45: | ||
<span style="color:red">Maybe look into this more. Sass/Assetic combination is not well documented. Not sure how to watch for changes in a whole directory outside of a bundle.</span> | <span style="color:red">Maybe look into this more. Sass/Assetic combination is not well documented. Not sure how to watch for changes in a whole directory outside of a bundle.</span> | ||
Assetic is an asset management tool created specifically for Symfony2. It looks like it can be used in place of grunt for the purposes of compiling Sass. The main benefit is that it saves the step of opening a shell and start up grunt to compile. | Assetic is an asset management tool created specifically for Symfony2. It looks like it can be used in place of grunt for the purposes of compiling Sass. The main benefit is that it saves the step of opening a shell and start up grunt to compile.<ref>[http://symfony.com/doc/current/cookbook/assetic/asset_management.html How To Use Assetic for Asset Management], Symfony documentation</ref> | ||
==== See also ==== | |||
* [http://alexandre-salome.fr/blog/Sass-Compass-Assetic-In-Ten-Minutes Sass, Compass, and Assetic in 10 minutes] (Alexandre Salomé) | * [http://alexandre-salome.fr/blog/Sass-Compass-Assetic-In-Ten-Minutes Sass, Compass, and Assetic in 10 minutes] (Alexandre Salomé) | ||
== Notes == | |||
<references/> | |||
[[Category:Symfony]] [[Category:PHP]] [[Category:CMS]] [[Category:Web Development]] | [[Category:Symfony]] [[Category:PHP]] [[Category:CMS]] [[Category:Web Development]] | ||
Latest revision as of 15:15, 25 January 2015
Overview[edit]
Notes on tasks related to setting up web projects using the Symfony framework.
Resource locations[edit]
- Controllers:
src/AppBundle/Controller/ - Models (Entities):
src/AppBundle/Entity/ - Templates:
app/Resources/views/ - Sass:
app/Resources/assets/ - Stylesheets:
- With Assetic:
src/AppBundle/Resources/public/sass/< (?) - Without Assetic"
web/css/
- With Assetic:
- Images:
- With Assetic:
src/AppBundle/Resources/public/images/ - Without Assetic"
web/images/
- With Assetic:
- JavaScript:
- With Assetic:
src/AppBundle/Resources/public/js/ - Without Assetic"
web/js/
- With Assetic:
With the Assetic paths, src\AppBundle\ is the location of the default app bundle, use whatever is appropriate for other bundles.
Templates[edit]
Twig template documentation[edit]
- Basics of syntax: Twig for Template Designers
Compass/Sass[edit]
Installation & Configuration[edit]
Install Compass into [project_root]app/Resources/assets/:
m:\path\to\project\app\Resources\assets\> compass init
The stylesheets will be written to [project_root]web/css/.
See also Install & Configure Sass & Compass
Assetic[edit]
Maybe look into this more. Sass/Assetic combination is not well documented. Not sure how to watch for changes in a whole directory outside of a bundle.
Assetic is an asset management tool created specifically for Symfony2. It looks like it can be used in place of grunt for the purposes of compiling Sass. The main benefit is that it saves the step of opening a shell and start up grunt to compile.[1]
See also[edit]
- Sass, Compass, and Assetic in 10 minutes (Alexandre Salomé)
Notes[edit]
- ↑ How To Use Assetic for Asset Management, Symfony documentation