Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to load Vendors in CakePHP 2.4.1 version?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 578
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: