Advertisement
Guest User

JYForm Problem 2

a guest
Sep 25th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.87 KB | None | 0 0
  1. i have a little problem here, I can create form and all the content created does show in database. newly created form also show on my page of `list of `jyforms`. however, when i clicked on each individual `jyform` to view the completed form, it always gave me a blank form, other than that, everything else is right, the page is showing, it does route to the right url `../public/jyform/j/jyform_id`, buttons looks alright. since the form creation part has nothing wrong, i assume there shouldn't be anything wrong on my template twig, so most likely the error is in `jyformController`, so i paste below the code for viewing selected jyform info:
  2.  
  3. public function pageJyform($jyform_id){
  4.  
  5.             $target_jyform = JYForm::find($jyform_id);
  6.  
  7.        $fields = ['user_id', 'name', 'date', 'number1', 'number2', 'number3'];
  8.        $show_fields = [];
  9.        $disabled_fields = [];
  10.        $hidden_fields = [];
  11.        foreach ($fields as $field){
  12.          $disabled_fields[] = "name";
  13.        }
  14.  
  15.        // Load validator rules
  16.        $schema = new \Fortress\RequestSchema($this->_app->config('schema.path') . "/forms/jyform-update.json");
  17.        $this->_app->jsValidator->setSchema($schema);
  18.  
  19.        $this->_app->render('jyforms/jyform-info.twig', [
  20.            "box_id" => 'view-jyform',
  21.            "alerts_id" => 'form-view-jyform-alerts',
  22.            "box_title" => $target_jyform->name,
  23.            "target_jyform" => $target_jyform,
  24.            "fields" => [
  25.                "disabled" => $disabled_fields,
  26.                "hidden" => $hidden_fields
  27.            ],
  28.            "buttons" => [
  29.                "hidden" => [
  30.                    "submit", "cancel"
  31.                ]
  32.            ],
  33.            "validators" => $this->_app->jsValidator->rules()
  34.        ]);
  35.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement