Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods in class FormView were deprecated and will be removed in Symfony 2.3. #45

Open
pawaclawczyk opened this issue Mar 2, 2014 · 0 comments
Assignees

Comments

@pawaclawczyk
Copy link
Owner

  • The following methods in class FormView were deprecated and will be
    removed in Symfony 2.3:

    • set
    • has
    • get
    • all
    • getVars
    • addChild
    • getChild
    • getChildren
    • removeChild
    • hasChild
    • hasChildren
    • getParent
    • hasParent
    • setParent

    You should access the public properties vars, children and parent
    instead.

    Before:

    $view->set('help', 'A text longer than six characters');
    $view->set('error_class', 'max_length_error');
    

    After:

    $view->vars = array_replace($view->vars, array(
        'help'        => 'A text longer than six characters',
        'error_class' => 'max_length_error',
    ));
    

    Before:

    echo $view->get('error_class');
    

    After:

    echo $view->vars['error_class'];
    

    Before:

    if ($view->hasChildren()) { ...
    

    After:

    if (count($view->children)) { ...
    
@pawaclawczyk pawaclawczyk added this to the Upgrade from 2.0 to 2.1 milestone Mar 2, 2014
@pawaclawczyk pawaclawczyk self-assigned this Mar 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant