Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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:
- public function pageJyform($jyform_id){
- $target_jyform = JYForm::find($jyform_id);
- $fields = ['user_id', 'name', 'date', 'number1', 'number2', 'number3'];
- $show_fields = [];
- $disabled_fields = [];
- $hidden_fields = [];
- foreach ($fields as $field){
- $disabled_fields[] = "name";
- }
- // Load validator rules
- $schema = new \Fortress\RequestSchema($this->_app->config('schema.path') . "/forms/jyform-update.json");
- $this->_app->jsValidator->setSchema($schema);
- $this->_app->render('jyforms/jyform-info.twig', [
- "box_id" => 'view-jyform',
- "alerts_id" => 'form-view-jyform-alerts',
- "box_title" => $target_jyform->name,
- "target_jyform" => $target_jyform,
- "fields" => [
- "disabled" => $disabled_fields,
- "hidden" => $hidden_fields
- ],
- "buttons" => [
- "hidden" => [
- "submit", "cancel"
- ]
- ],
- "validators" => $this->_app->jsValidator->rules()
- ]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement