Backend\Modules\FormBuilder\Actions\DataDetails::parse PHP Method

parse() protected method

Parse
protected parse ( )
    protected function parse()
    {
        parent::parse();
        // form info
        $this->tpl->assign('name', $this->record['name']);
        $this->tpl->assign('formId', $this->record['id']);
        // sent info
        $this->tpl->assign('id', $this->data['id']);
        $this->tpl->assign('sentOn', $this->data['sent_on']);
        // init
        $data = array();
        // prepare data
        foreach ($this->data['fields'] as $field) {
            // implode arrays
            if (is_array($field['value'])) {
                $field['value'] = implode(', ', $field['value']);
            } else {
                // new lines to line breaks
                $field['value'] = nl2br($field['value']);
            }
            // add to data
            $data[] = $field;
        }
        // assign
        $this->tpl->assign('data', $data);
        $this->tpl->assign('filter', $this->filter);
    }