forms - Including and using Zend Service ReCaptcha in ZF2 (v2.3.3) -



forms - Including and using Zend Service ReCaptcha in ZF2 (v2.3.3) -

how include recaptcha service in zend framework 2?

i tried this:

public function contactaction() { $formcontact = new contactform(); $pubkey = 'mypubkey'; $privkey = 'myprivkey'; $recaptcha = new zendservice\recaptcha\recaptcha($pubkey, $privkey); homecoming array ('formcontact' => $formcontact, 'recaptcha' => $recaptcha); }

but discovered zendservice\recaptcha not nowadays default when download framework. so, downloaded here https://github.com/zendframework/zendservice_recaptcha

and placed vendor\zendframework\zendframework\library\zend other parts of library.

i tried refresh page doesn't work 1 time again because can't find zend service recaptcha.

fatal error: class 'application\controller\zendservice\recaptcha\recaptcha' not found in c:\program files (x86)\xampp\htdocs\zf-tutorial\module\application\src\application\controller\indexcontroller.php on line 79

can help me? thought simple implement recaptcha, not ! thanks!

add zendservice-recaptcha module composer.json file , run update:

{ ... "repositories": [ { "type": "composer", "url": "http://packages.zendframework.com/" } ], ... "require": { ... "zendframework/zendservice-recaptcha": "*", ... } ... }

update composer :

php composer.phar update

this install module , configure relevant class mapping , able access classes adding utilize statements other classes use.

forms zend-framework2 recaptcha zend-form2

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -