weedo tech blog

le blog technique de la team weedo

  • Home
  • Ka on twitter
    • Edit
    • Delete
    • Tags
    • Autopost

    Debugger symfony

    A partir de maintenant, ne plus debbuger du code avec des echos et des var_dump svp. Utiliser les outils Symfony.

    A lire : http://www.symfony-project.org/book/1_2/16-Application-Management-Tools

    Notamment :
    Adding a Log Message
    You can manually add a message in the symfony log file from your code by using one of the techniques described in Listing 16-5.

    Listing 16-5 - Adding a Custom Log Message

    // From an action
    $this->logMessage($message, $level)
    ;

    // From a template


    Et pour logger une array ou un objet, utiliser ob :
    Exemple :

    $array = ($this->getRequest()->getParameter("contact"));
    //Oh, mais comment logger un tableau ???
    ob_start();
    var_dump($array);
    $result = ob_get_clean();
    $this->logMessage($result);

    Tags » symfony123
    • 26 November 2009
    • Views
    • 0 Comments
    • Permalink
    • Favorited 0 Times
    • Tweet
    • Tweet

    Comments 0 Comments

    Leave a Comment

  • About Karim Cassam Chenaï

    My Google Profile

  • Contributors

    • Ballut Vincent
    • fix
    • Karim Cassam Chenaï
  • Subscribe

    Subscribe to this posterous
    Unsubscribe
    Follow this posterous RSS
    You're a contributor here (Edit)
    This is your Space (Edit)
    Follow by email »
    Get the latest updates in your email box automatically.
  • Follow Me

      Delicious

Theme created for Posterous by Obox