This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Symfony 2.2+ Configuration Files Help

Discuss installing Symfony 2 here

Symfony 2.2+ Configuration Files Help

by hardcoremore » Wed May 22, 2013 3:31 pm

Hi all,


I am a new user of Symfony framework. Never used Symfony before prior to 2.2 version.

I like the idea behind Symfony and its usage but I am finding many stumbling rocks while I am reading documentation and trying to configure and use Symfony for the first time.

I understand that devs probably did not have time ti write complete documentation so I am asking help here on the forum.

I need help in understanding several aspects of firewall, csrf, form and template configurations.


TWIG TEMPLATE CONFIGURATION

I found http://symfony.com/doc/current/referenc ... /twig.html link in the Symfony 2 documentation. But I do not understand most of the configuration attributes.

Is there any link that better explains attributes for twig config?

For example what does

form:
resources:

# Default:
- form_div_layout.html.twig

# Example:
- MyBundle::form.html.twig

means?

and

strict_variables: ~
auto_reload: ~
optimizations: ~



SECURITY CONFIGURATION

In the http://symfony.com/doc/current/book/sec ... login-form

I found this config:

security:
firewalls:
secured_area:
pattern: ^/
anonymous: ~
form_login:
login_path: login
check_path: login_check


But I do not understand what does property secured_area means. Is the name secured_area reserved keyword in config and if it is not where it is referred.

For example where should I use name secured_area in other parts of Symfony?
Also what does anonymous property means?


Best regards and keep up the good work with Symfony because it is great framework.
hardcoremore
Junior Member
 
Posts: 10
Joined: Wed May 22, 2013 2:44 pm

Re: Symfony 2.2+ Configuration Files Help

by tiagojsag » Mon Jun 03, 2013 11:14 am

Hi,

http://symfony.com/doc/2.2/cookbook/for ... omizations

secured_area is NOT a reserved word, is the name of a firewall that you can change (as long, ofc, you change it too in other config entries if/where it shows up).
Think of firewalls as authentication domains. For example, if you have a blog, you may have a "front" firewall where users authenticate in /login to post comments. Then, independently, you can have an "admin" firewall, where users go to "/admin/login" to authenticate and can create new posts, for example. This is an overly simplified example, and different firewalls do NOT relate to permissions. It's more of a logical abstraction than a functional one, I think.

If you're new to sf2, stick with one firewall. If you ever need more than one, the concept itself will sink in alone, and you can use the reference to config aditional ones.

cheers
Tiago Garcia
@tiagojsag

Core Web Developer @ Shopware
http://www.shopware.de
User avatar
tiagojsag
Faithful Member
 
Posts: 885
Joined: Wed Aug 10, 2011 4:58 pm