Answer the question
In order to leave comments, you need to log in
What is the correct way to instantiate a class in Kohana?
I install the package https://packagist.org/packages/sunhater/kcfinder in Kohana 3.3 using composer:
In the root of the site I execute the commands: curl -s http://getcomposer.org/installer | php
php composer.phar require sunhater/kcfinder
In bootstrap.php, before loading the module, I add: require('vendor/autoload.php');
I try to use the class in the controller (I call it the way it is called in browse.php file of the kcfinder plugin):
$browser = "kcfinder\\browser"; // To execute core/bootstrap.php on older
$browser = new $browser(); // PHP versions (even PHP 4)
$browser->action();
При переходе на нужный екшн получаю ошибку:
Answer the question
In order to leave comments, you need to log in
Maybe you need it like this?
$browser = new \sunhater\kcfinder\browser();
$browser->action();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question