Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zebra_Form CSS class not added to the form #34

Open
vhotspur opened this issue Apr 3, 2017 · 0 comments
Open

Zebra_Form CSS class not added to the form #34

vhotspur opened this issue Apr 3, 2017 · 0 comments

Comments

@vhotspur
Copy link

vhotspur commented Apr 3, 2017

When running the example, the form is not styled, JavaScript validation does not work.

I think the culprit is in the initialization of the Zebra_Form class where $attributes are (by default) initialized to an empty string instead of an empty array. Consequent adding of the Zebra_Form CSS class (in render()) thus does not modify the array as intended.

I think this is related to upgrade to PHP 7 as I have not seen this behaviour several month ago.

Anyway, for me the following patch worked:

--- a/Zebra_Form.php
+++ b/Zebra_Form.php
@@ -163,7 +163,7 @@ class Zebra_Form
      *
      *  @return void
      */
-    function __construct($name, $method = 'POST', $action = '', $attributes = '')
+    function __construct($name, $method = 'POST', $action = '', $attributes = [])
     {
 
         $this->controls = $this->variables = $this->errors = $this->master_labels = array();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant