Skip to content

Commit

Permalink
Add size parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
shevabam committed Aug 14, 2017
1 parent 1f538a6 commit cdb88f7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"source": "https://github.com/shevabam/recaptcha/tree/master"
},
"license": "GNU GPL 2.0",
"version": "1.0.2",
"version": "1.0.3",
"require": {
"php": ">=5.3.0"
},
Expand Down
24 changes: 24 additions & 0 deletions src/reCAPTCHA.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ class reCAPTCHA
*/
protected $language = null;

/**
* Captcha size. Default : normal
*
* @var string
* @see https://developers.google.com/recaptcha/docs/display#render_param
*/
protected $size = null;



/**
Expand Down Expand Up @@ -179,6 +187,19 @@ public function setLanguage($language)
return $this;
}

/**
* Set size
*
* @param string $size (see https://developers.google.com/recaptcha/docs/display#render_param)
* @return object
*/
public function setSize($size)
{
$this->size = $size;

return $this;
}

/**
* Generate the JS code of the captcha
*
Expand Down Expand Up @@ -210,6 +231,9 @@ public function getHtml()
if (!is_null($this->type))
$data .= ' data-type="'.$this->type.'"';

if (!is_null($this->size))
$data .= ' data-size="'.$this->size.'"';

return '<div class="g-recaptcha" '.$data.'></div>';
}
}
Expand Down

0 comments on commit cdb88f7

Please sign in to comment.