Welcome Guest, Not a member yet? Register   Sign In
"Use" Command with CI?

I've installed PhantomJS and PHP-PhantomJS per the PHP-PhantomJS docs.

Per the PHP-PhantomJS docs, I have the following lines at the top of a controller file:

   use JonnyW\PhantomJs\Client;
   $client = Client::getInstance();

When executing `$client = Client::getInstance();`, I get the error:

Quote:'JonnyW\PhantomJs\Client' not found

The installer has placed `JonnyW\PhantomJs\Client` here:


The controller that contains the "use" command is located here:


How can I modify the "use" command so as to locate the required "JonnyW\PhantomJs\Client" file?

Thanks in advance to all for any info.

Is your composer turned on in your config file? Try running the command 'sudo dump-autoload' wherever your composer.json file is stored.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!

I've used npm a lot for node.js, but this is my first time using Composer (with PHP of course). Here is my current composer.json file, (which is located in the same directory as index.php):

        "require": {
            "jonnyw/php-phantomjs": "4.*"
        "config": {
            "bin-dir": "bin"
        "scripts": {
            "post-install-cmd": [
            "post-update-cmd": [

What is the correct way to modify this file so as to turn on composer?

Navigate to your application/config/config.php file and set
$config['composer_autoload'] = TRUE; //around 134 line

That worked. Thanks!

(03-03-2017, 03:48 AM)VikRubenfeld Wrote: That worked. Thanks!

You welcome

Theme © iAndrew 2016 - Forum software by © MyBB