Open VikR0001 opened 7 years ago
The docs appear to leave out a required step.
The docs show this as the code required for procedureLoader:
use JonnyW\PhantomJs\Client;
use JonnyW\PhantomJs\DependencyInjection\ServiceContainer;
$location = '/path/to/your/script/directory';
$serviceContainer = ServiceContainer::getInstance();
$procedureLoader = $serviceContainer->get('procedure_loader_factory')
->createProcedureLoader($location);
$client = Client::getInstance();
$client->getProcedureLoader()->addLoader($procedureLoader);
$request = $client->getMessageFactory()->createRequest();
$response = $client->getMessageFactory()->createResponse();
$client->send($request, $response);
But it appears to be necessary to add a call to setProcedure:
$client->setProcedure('phantomjsTest');
With the setProcedure
call added, the code is now working!
Apologies. I will update the documentation.
I'm learning php-phantomjs and am gettting a Twig_Error_Runtime. Here's my PHP:
...and here's my .proc file:
What am I missing? Thanks in advance to all for any info.