Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat: allow modifying the Form schema class
  • Loading branch information
josegonzalez committed Feb 4, 2018
1 parent 887b3f0 commit 7846f7d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Form/Form.php
Expand Up @@ -35,6 +35,12 @@
*/
class Form
{
/**
* Schema class.
*
* @var string
*/
protected $_schemaClass = '\Cake\Form\Schema';

/**
* The schema used by this form.
Expand Down Expand Up @@ -70,7 +76,7 @@ class Form
public function schema(Schema $schema = null)
{
if ($schema === null && empty($this->_schema)) {
$schema = $this->_buildSchema(new Schema());
$schema = $this->_buildSchema(new $this->_schemaClass);
}
if ($schema) {
$this->_schema = $schema;
Expand Down

0 comments on commit 7846f7d

Please sign in to comment.