title: Laravel : Calling functions defined in base_controller from view
body: <p>In using the laravel framework, how can I call a function defined in base_controller, in a view.  For exacmple:</p>
  
  <pre><code>class Base_Controller extends Controller {
  
      public static function format_something()
      {
           return something;
      }
  }
  </code></pre>
  
  <p>How can i call format_something() in a view file?</p>
  
  <p>Usually the error I get looks something like this:
      Method [link_to_action] is not defined on the View class.</p>
  
  <p>Probably a silly question, but thanks in advance!</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Okay! First the correct place to do something like this is in the libraries folder.
  Second, problem is that your class cannot have underscores.</p>
  
  <p>So in application/libraries I made file AppHelper.php with class</p>
  
  <pre><code>class AppHelper {
  
      public static function format_something()
      {
          return something;
      }
  }
  </code></pre>
  
  <p>And can call it like:</p>
  
  <pre><code>$formated = AppHelper::format_something;
  </code></pre>
  
  <p>Thanks for the help and the good forum find Boofus McGoofus.</p>