title: How to pass url to php class constructor
body: <p>I want to include this <a href="https://github.com/emotionLoop/visualCaptcha-PHP" rel="nofollow">https://github.com/emotionLoop/visualCaptcha-PHP</a> code as a library.</p>
  
  <p>So I'm including class from outside folder like this:</p>
  
  <pre><code>&lt;?php printCaptcha('contact_us_form_vc',$_FORM_TYPE,$_FIELD_NAME); ?&gt;
  
  function printCaptcha($formId = NULL, $type = NULL, $fieldName = NULL) {
      require_once(SITE_ROOT . '/visualCaptcha/inc/visualcaptcha.class.php');
      $visualCaptcha = new \visualCaptcha\Captcha($formId, $type, $fieldName);
      $visualCaptcha-&gt;show();
  }
  </code></pre>
  
  <p>Inside class there are variables I want to pass from my function:</p>
  
  <pre><code>private $htmlClass = 'visualcaptcha.class.html.php';
      public static $imagesPath = 'images/visualcaptcha/';
      public static $audiosPath = 'audio/visualcaptcha/';
      public static $imageFile = 'image.php';
      public static $audioFile = 'audio.php';
  </code></pre>
  
  <p>Any ideas how to pass them?</p>
  
  <p>What I did:</p>
  
  
  
  <pre><code>function printCaptcha($formId = NULL, $type = NULL, $fieldName = NULL, $htmlClass = NULL) {
      require_once(SITE_ROOT . '/visualCaptcha/inc/visualcaptcha.class.php');
      $visualCaptcha = new \visualCaptcha\Captcha($formId, $type, $fieldName, $htmlClass);
      $visualCaptcha-&gt;show();
  }
  </code></pre>
  
  <p>And than inside class:</p>
  
  <pre><code>public function __construct( $formId = NULL, $type = NULL, $fieldName = NULL, $accessibilityFieldName = NULL, $htmlClass = NULL )
  </code></pre>
  
  <p>And added:</p>
  
  <pre><code>if ( ! is_null($htmlClass) ) {
              $this-&gt;htmlClass = $htmlClass;
          }
  </code></pre>