Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
3ccfdf1c93 | |||
b703ed1a0c | |||
25de43ac90 | |||
1b4835eb4d | |||
be1ce45060 | |||
0f6cd70920 | |||
754310f488 |
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Gregwar\CaptchaBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
@ -11,7 +11,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
*
|
||||
* @author Jeremy Livingston <jeremy.j.livingston@gmail.com>
|
||||
*/
|
||||
class CaptchaController extends Controller
|
||||
class CaptchaController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* Action that is used to generate the captcha, save its code, and stream the image
|
||||
|
@ -14,8 +14,14 @@ class Configuration implements ConfigurationInterface
|
||||
*/
|
||||
public function getConfigTreeBuilder()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder();
|
||||
$rootNode = $treeBuilder->root('gregwar_captcha');
|
||||
$treeBuilder = new TreeBuilder('gregwar_captcha');
|
||||
|
||||
if (method_exists($treeBuilder, 'getRootNode')) {
|
||||
$rootNode = $treeBuilder->getRootNode();
|
||||
} else {
|
||||
// BC for symfony/config <= 4.1
|
||||
$rootNode = $treeBuilder->root('gregwar_captcha');
|
||||
}
|
||||
|
||||
$rootNode
|
||||
->addDefaultsIfNotSet()
|
||||
|
@ -1,3 +1,3 @@
|
||||
gregwar_captcha.generate_captcha:
|
||||
path: /generate-captcha/{key}
|
||||
defaults: { _controller: GregwarCaptchaBundle:Captcha:generateCaptcha }
|
||||
defaults: { _controller: Gregwar\CaptchaBundle\Controller\CaptchaController::generateCaptchaAction }
|
||||
|
@ -2,7 +2,7 @@
|
||||
{% if is_human %}
|
||||
-
|
||||
{% else %}
|
||||
{% spaceless %}
|
||||
{% apply spaceless %}
|
||||
<img class="captcha_image" id="{{ image_id }}" src="{{ captcha_code }}" alt="" title="captcha" width="{{ captcha_width }}" height="{{ captcha_height }}" />
|
||||
{% if reload %}
|
||||
<script type="text/javascript">
|
||||
@ -14,6 +14,6 @@
|
||||
<a class="captcha_reload" href="javascript:reload_{{ image_id }}();">{{ 'Renew'|trans({}, 'gregwar_captcha') }}</a>
|
||||
{% endif %}
|
||||
{{ form_widget(form) }}
|
||||
{% endspaceless %}
|
||||
{% endapply %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
@ -20,7 +20,8 @@
|
||||
"php": ">=5.3.9",
|
||||
"gregwar/captcha": "~1.1",
|
||||
"symfony/framework-bundle": "~2.8|~3.0|~4.0",
|
||||
"symfony/form": "~2.8|~3.0|~4.0"
|
||||
"symfony/form": "~2.8|~3.0|~4.0",
|
||||
"twig/twig": "^1.40|^2.9"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
Reference in New Issue
Block a user