From 49cb96b5340fa4f65a9a685149efe9bda73cb600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Passault?= Date: Fri, 26 Aug 2011 08:59:29 +0200 Subject: [PATCH] Adding title, width & height and updating README --- Generator/CaptchaGenerator.php | 1 + README.md | 13 +++++++++++++ Resources/views/captcha.html.twig | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Generator/CaptchaGenerator.php b/Generator/CaptchaGenerator.php index 38b40f5..c923497 100644 --- a/Generator/CaptchaGenerator.php +++ b/Generator/CaptchaGenerator.php @@ -22,6 +22,7 @@ class CaptchaGenerator { public function generate() { $i = imagecreatetruecolor(120,40); + $col = imagecolorallocate($i, mt_rand(0,110), mt_rand(0,110), mt_rand(0,110)); imagefill($i, 0, 0, 0xFFFFFF); diff --git a/README.md b/README.md index 57976ce..67b0534 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,19 @@ You can use the "captcha" type in your forms this way: Note that the generated image will be embeded in the HTML document, to avoid dealing with route and subrequests. +Form theming +============ + +If you want to put the image in an other way, you can form theme `captcha_bundle` (this +is the default behavior) : + +```html +{% block captcha_widget %} + + {{ form_widget(form) }} +{% endblock %} +``` + License ======= diff --git a/Resources/views/captcha.html.twig b/Resources/views/captcha.html.twig index 22ebfea..7a44969 100644 --- a/Resources/views/captcha.html.twig +++ b/Resources/views/captcha.html.twig @@ -1,4 +1,4 @@ {% block captcha_widget %} -
+ {{ form_widget(form) }} {% endblock %}