Symfony 2.3 Beginners Tutorial - Part 4 - Twitter Bootstrap & Symfony 2

preview_player
Показать описание
In part 3 we looked at a basic controller with an even more basic template. But in the real world you will more than likely want to use a web framework to speed up your development - enter Twitter Bootstrap, or just Bootstrap as it's recently re-branded too.

There are a few ways to set up Bootstrap so it plays nicely with your Symfony 2 install, and this is the way I have had most success with.
Рекомендации по теме
Комментарии
Автор

I'm having to learn Symfony2 for a project I'm working on and I must say these are the best free tutorials I've found on the entire internet! Without you I'd still be stuck on how to install the thing!

Thank you so much and keep up the truly amazing work! :D

Muthwill
Автор

After a few hours of struggling with symfony, making it say "Hello World!" felt like making a Dragon roll over. Thanks, Chris!

Caphalem
Автор

Thanks Artem :) I didn't know that. I would genuinely encourage anyone developing with a framework like Symfony 2 to try it using a Linux (or similar) environment, as that's most likely going to be what you are deploying too. On the downside it adds to the already daunting learning curve, but it's good to know all the same.

CodeReviewVideos
Автор

Great video! Really enjoyed your trouble shooting, personalized the experience greatly . Look forward to more tutorials by you. . =}

SJ-cioi
Автор

Awesome tutorials... Thanks a lot.. Please keep up the good work...

sathishnec
Автор

Great Tutorial. Thanks Chris. By d Way i really like the way you say "Bundle" !! :)

Hardiiix
Автор

Nice Tuts!
Will you do something related with REST?

mateuszzmuda
Автор

For those who want to know: symlinks exists in windows. The tool is called junction and is available on the sysinternals page. Probably not that comfortable. Btw. I was wondering what happens to the slashes on sub-templates on windows webservers (not that I needed it). A stackoverflow article says its still slashes. Seems that twig takes care on these issues which is pretty cool. If I had to explain symlinks I would explain it as a shortcut in windows or a kind of pointer (which might be even more confusing :-) )

markus
Автор

Great tutorial, but there are in fact symbolic links in windows and they work essentially the same.
Do a "mklink /?" in a console to see for yourself. :)
That's for Vista and later, for previous versions there was some other eerie command.

basartevg
Автор

Lmfao "something's gone pear-shaped" is my new phrase!

TheTigero
Автор

Hi Chris,

Just a small thing would like to add for audience.
Make sure you have both cssembed and yuicompressor under java folder.
From the video I cought just the cssembed jar. Maybe I didn't paid attention.

> cd app/Resources 
> mkdir java
> cd java

Under composer.json:

"require": {
...
"leafo/lessphp": "~0.3.9",
"twitter/bootstrap": "v2.3.2",
"components/jquery": "dev-master"
}

Under config.yml:

assetic:
assets:
   jquery_js:
       inputs:
           -

For me the path was incorrect so had to change it with above.

Not bad to have less installed:
> sudo npm install less

After you have all these right, can run:

> sudo php app/console cache:clear
> sudo composer update
> sudo php app/console assetic:dump --force

Don't stop with these series.
Madalin

madalinmocanita
Автор

Hi, thank you for the tutotials, which it is the advantage of integrate boostrap this way and not with de regular way?

dannyalfonzo
Автор

Great Tutorial! But it is more simple to just download jquery, bootstrap js and bootstrap css files, into your js, css folder and link them! :)

lennondtps
Автор

I had problems using leafo as I got some less errors. I changed to Oyejorge. Coming over from Drupal, I think using Oyejorge is a better solution. Is there a way to sort out the problem with leafo?

adamrogers
Автор

Cannot for the life of me get bootstrap installed the way suggested,
even tried lower version of bootstrap and oyejorge/less.php

A blog update or something with a solution would be great, or a link to another source. I could not find any other way to install bootstrap besides <style href="">

nflz
Автор

Hi Chris, Great video, I m new to symphony and stuck up here, even after installing jquery using composer assetic:dump command is showing jquery.min.js missing error again and again. On loading the page the error says "You must add MCMDemoBundle to the assetic.bundle config to use the {% javascripts %} " . Please help me.

tryingItOut
Автор

Hi, i am new to symfony and i have a question, Why not to just download jquery and bootstrap and link them into the template ???
Same with sass why not to just link the produced css files to the template ???

AchilleasTheOfficial
Автор

Hi! It looks to me like you are missing the title end tag in base.html.twig. 

Stagleton
Автор

When you can make things easy, please make things easy.   You took the longest route for the twitter bootstrap.

BTW.  Nice tutorials before and after this video.

GaneshKumarButcha
Автор

I'm sorry but I hate the little tics you do while you're speaking. It's really disturbing.

degecko
welcome to shbcf.ru