Last active
August 29, 2015 14:06
-
-
Save samsonasik/565ffee6609d993d683a to your computer and use it in GitHub Desktop.
zendservice-recaptcha
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "zendframework/skeleton-application", | |
"description": "Skeleton Application for ZF2", | |
"license": "BSD-3-Clause", | |
"keywords": [ | |
"framework", | |
"zf2" | |
], | |
"homepage": "http://framework.zend.com/", | |
"require": { | |
"php": ">=5.3.3", | |
"zendframework/zendframework": "2.3.*", | |
"zendframework/zendservice-recaptcha":"dev-master" | |
}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php composer.phar update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
'recaptcha' => array( | |
'pubKey' => 'YOURRECAPTCHAPUBLICKEY', | |
'privKey' => 'YOURRECAPTCHAPRIVATEKEY', | |
), | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
'service_manager' => array( | |
'factories' => array( | |
'reCaptchaService' => function(Zend\ServiceManager\ServiceManager $sm) { | |
$config = $sm->get('Config'); | |
$recaptcha = $config['recaptcha']; | |
return new ZendService\ReCaptcha\ReCaptcha($recaptcha['pubKey'], $recaptcha['privKey']); | |
}, | |
), | |
), | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function indexAction() | |
{ | |
$recaptcha = $this->getServiceLocator()->get('reCaptchaService'); | |
echo $recaptcha->getHTML(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment