Magento - loading external php scripts inside controller

Wednesday, November 4, 2015

Any time I want to load an external library from inside a class conforming to the Magento module approach. I am always faced with the following error:




require_once(): Failed opening required 'http://example.com/HTML2PDF/tcpdf.php'




Despite that the URL is correct. For example:



class Foo_Bar_AccountController extends Mage_Customer_AccountController 
{
public function whatever() {
require_once(Mage::getBaseUrl() . 'HTML2PDF/tcpdf.php');
}
}


Can anyone help understand why I cannot include files this way?

0 comments:

Post a Comment