title: Use Ruler library in codeigniter project
body: <p>I am trying to integrate the Ruler library available on the link below into my codeigniter project.</p>
  
  <p><a href="https://github.com/bobthecow/Ruler" rel="nofollow noreferrer">https://github.com/bobthecow/Ruler</a></p>
  
  <p>I installed and configured it using the steps given in these links. But still not able to use the methods from the library. I tried the example code from the library but its not working. Looks like the Ruler library is not getting with my project and so the methods are not resolved. Looking for help to get this working.</p>
  
  <p>The Steps I followed are </p>
  
  <ol>
  <li>Run composer require ruler/ruler to install the library</li>
  <li>a new folder named vendor is created and it contains the ruler library code</li>
  <li>I move it to application folder in my project</li>
  <li>Edit the <code>application/config/config.php</code>, find the setting <code>$config['composer_autoload']</code> and Set it to TRUE</li>
  <li>load the library using this code to use in controller <code>$this-&gt;load-&gt;library('ruler)</code></li>
  </ol>
  
  <p><a href="https://forum.codeigniter.com/thread-61112-post-315197.html#pid315197" rel="nofollow noreferrer">https://forum.codeigniter.com/thread-61112-post-315197.html#pid315197</a></p>
  
  <p><a href="https://stackoverflow.com/questions/13741917/how-to-use-composer-packages-in-codeigniter">How to use composer packages in codeigniter?</a></p>
  
  <p><a href="https://arjunphp.com/how-to-use-composer-with-codeigniter/" rel="nofollow noreferrer">https://arjunphp.com/how-to-use-composer-with-codeigniter/</a></p>
  
  <p><a href="https://stackoverflow.com/questions/11625458/integrate-phpgrid-with-codeigniter/11645624#comment15735065_11645624">Integrate phpgrid with codeigniter</a></p>
  
  <p><a href="https://stackoverflow.com/questions/9665095/how-to-adapt-a-php-library-to-codeigniter">How to adapt a PHP library to Codeigniter?</a></p>
  
  <p>To test if its working, I added this function in my controller and on executing it, i do not see any echo</p>
  
  <p>I executed the steps given in the links in my question. To check if everything is working, i created a new function in my controller like this    public <pre></p>
  
  <pre><code>function testing()
      {
          $rb = new RuleBuilder;
          $rule = $rb-&gt;create(
              $rb-&gt;logicalAnd(
                  $rb['minNumPeople']-&gt;lessThanOrEqualTo($rb['actualNumPeople']),
                  $rb['maxNumPeople']-&gt;greaterThanOrEqualTo($rb['actualNumPeople'])
                  ),
              function() {
                  echo 'YAY!';
              }
              );
          $context = new Context(array(
              'minNumPeople' =&gt; 5,
              'maxNumPeople' =&gt; 25,
              'actualNumPeople' =&gt; function() {
              return 6;
              },
              ));
  
          $rule-&gt;execute($context); // "Yay!"
  </code></pre>
  
  <p></pre></p>