Welcome Guest, Not a member yet? Register   Sign In
How do I instantiate a custom class based helper in a view
#1

I have inherited a site based on the CI framework.

There is a custom helper 'imageresize_helper.php' built as a class with constructor rather than just functions:

Class ImageResize
{
   
   private $fileName;

   /**
   * @param string $fileName
   */
   function __construct($fileName)
   {
       $fileName = base_path($fileName);
   }


...

public function resizeImage($newWidth, $newHeight, $option = 'auto')
   {

}

The helper is referenced in autoload.php 
$autoload['helper'] = [
   'imageresize',
]   


How do I load & instantiate the helper class and call the resize function in a view?

Thanks

SeanR
Reply


Messages In This Thread
How do I instantiate a custom class based helper in a view - by seanr - 12-01-2018, 09:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB