Adding title, width & height and updating README
This commit is contained in:
parent
e9e2cf5179
commit
49cb96b534
@ -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);
|
||||
|
13
README.md
13
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 %}
|
||||
<img src="{{ captcha_code }}" title="captcha" width="120" height="40" />
|
||||
{{ form_widget(form) }}
|
||||
{% endblock %}
|
||||
```
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% block captcha_widget %}
|
||||
<img src="{{ captcha_code }}" /><br />
|
||||
<img src="{{ captcha_code }}" title="captcha" width="120" height="40" />
|
||||
{{ form_widget(form) }}
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user