Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to load Vendors in CakePHP 2.4.1 version?
If you want load Vendors in Your CakePHP web application then you should use App::import('Vendor', filename),
If you will use App::uses() then you can not load vendors because App::uses() not allow to expect external libraries.
If you want to load Vendors then should follow below syntax
App::import('Vendor', Filename)
Your Vendors files does not follow assembly and it has a class which will be different from file name.
You can see following example:
<?php
App::import('Vendor', 'mailer', array('file' => 'class.phpmailer.php'));
App::import('Vendor', 'sms', array('file' => 'class.sms.php'));
?>
In above example class.phpmailer and class.sms should be in lower-case otherwise CakePHP will not find to Vendor. This Vendor files can be located in any of the Vendor folders.
0 Comment(s)