title: How can I get variable from the file config.yml?
body: <p>Welcome
  I have a file config.yml</p>
  
  <pre><code>d_facebook:
      file:   %kernel.root_dir%/../src/FacebookBundle/Facebook/FacebookInit.php
      app_id: 296925470418713
      secret: fb4d0a99bcf80e55f47077ffadcac921
      cookie: true
      permissions: [email, user_birthday, user_location, user_about_me, user_location]
  </code></pre>
  
  <p>Then I have this class, which retrieves data from the file config.yml</p>
  
  <pre><code>&lt;?php
  
  namespace D\FacebookBundle\Facebook;
  
  use Symfony\Component\Yaml\Yaml;
  use Symfony\Component\DependencyInjection\ContainerBuilder;
  
  use D\FacebookBundle\Facebook\Facebook;
  use D\FacebookBundle\Facebook\FacebookConfig;
  
  class FacebookInit
  {
      public $hAPI;
      public $userProfile;
      public $user;
      public $logoutUrl;
      public $loginUrl;
      public $config;
  
      public function __construct()
      {
          $this-&gt;config = Yaml::parse('/facebookx/app/config/config.yml');
  
          $this-&gt;hAPI = new Facebook(array(
              'appId' =&gt; $this-&gt;config['d_facebook']['app_id'],
              'secret' =&gt; $this-&gt;config['d_facebook']['secret']
              ));
          $this-&gt;setUserProfile();
      }
  }
  </code></pre>
  
  <p>What better way to do this? How can I get variable from the file config.yml?
  I ask for an example?</p>