jeudi 28 juillet 2016

BingTranslator. What is wrong with this Laravel 5.1 import?

I used this tutorial: http://ift.tt/2a6ZbPo

Namespace and class name: "namespace App\AppUtilities; class BingTranslator{ "

used this to import the class: "use App\AppUtilities\BingTranslator;"

I am trying to use it like that: "$translator = new BingTranslator('here I putted my appId', 'and here my secret key'); $city2 = $translator->getTranslation('da','en',$city); echo($city2);"

And I get this error from when trying to access it: "FatalErrorException in Handler.php line 27: Uncaught TypeError: Argument 1 passed to App\Exceptions\Handler::report() must be an instance of Exception, instance of ParseError given, called in /var/www/http://ift.tt/2ajnHA7 on line 73 and defined in /var/www/http://ift.tt/2a6ZauS Stack trace:

0 /var/www/http://ift.tt/2ajohxP: App\Exceptions\Handler->report(Object(ParseError))

1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(ParseError))

2 {main}

thrown"

I am new in Laravel and I can not understand where is the mistake. The error does not show me exactly what is wrong so I am kinda stuck here. Plus if there is a way to show the exact error every time I would be glad if you can help me with that too.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire