From a0e8f4c846647866759699d20948d10826c9d17f Mon Sep 17 00:00:00 2001 From: Maxim Kerstens Date: Thu, 2 Jul 2015 11:52:17 +0200 Subject: [PATCH] Don't force parsley property to be initialized --- src/HappyDemon/LaravelParsley/FormBuilder.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/HappyDemon/LaravelParsley/FormBuilder.php b/src/HappyDemon/LaravelParsley/FormBuilder.php index b7f0883..0bcea65 100644 --- a/src/HappyDemon/LaravelParsley/FormBuilder.php +++ b/src/HappyDemon/LaravelParsley/FormBuilder.php @@ -79,7 +79,8 @@ public function helpBlock($value, array $options = []) */ public function input($type, $name, $value = null, $options = []) { - $options = array_merge($options, $this->parsley->getFieldRules($name)); + if($this->parsley != null) + $options = array_merge($options, $this->parsley->getFieldRules($name)); return parent::input($type, $name, $value, $options); } @@ -89,14 +90,16 @@ public function input($type, $name, $value = null, $options = []) */ public function textarea($name, $value = null, $options = []) { - $options = array_merge($options, $this->parsley->getFieldRules($name)); + if($this->parsley != null) + $options = array_merge($options, $this->parsley->getFieldRules($name)); return parent::textarea($name, $value, $options); } public function select($name, $list = [], $selected = null, $options = []) { - $options = array_merge($options, $this->parsley->getFieldRules($name)); + if($this->parsley != null) + $options = array_merge($options, $this->parsley->getFieldRules($name)); return parent::select($name, $list, $selected, $options); }