cakephpcakephp-2.0tcpdf

How to escape plugin notation in App::uses() for CakePHP 2.x


I'm using CakePHP 2.7 and want to use a Vendor class by stating

App::uses('TCPDF', 'tecnick.com/tcpdf');

Cake complains because it is trying to load a file from the tecnick plugin.

I actually am aiming for a vendor class in /vendor/tecnick.com/tcpdf. The confusion is obviously caused by the . in the vendor filepath.

How do I escape the dot in App::uses()?


Solution

  • You need to use App::import, plugin should be in App/Vendor folder and full stop needs to be escaped:

    App::import("Vendor", "tecnick\.com/tcpdf.php");