<?php theme::form_start($controller_path . '/' . $controller_action, $record->id); theme::header_start(ucfirst($controller_action) . ' ' . $controller_title); theme::header_button('cancel'); theme::header_end(); theme::hr(0, 12); theme::start_form_section('Name', true, 5); theme::text('name', $record->name); theme::end_form_section(); theme::start_form_section('Age', true, 1); theme::text('age', $record->age); theme::end_form_section(); theme::start_form_section('Textarea'); theme::textarea('text', $record->text); theme::end_form_section(); theme::portal_header_start('Title Goes here'); theme::portal_header_button('Add', 'magic', ['data-child_id' => 'child1', 'data-url' => $controller_path . '/new_child', 'class' => 'btn btn-default btn-xs add_child']); theme::portal_header_end(); theme::portal_start(189, 0, ['id' => 'child1']); foreach ($childern as $sf) { ci()->load->view('form/new_child', ['parent_id' => $record->id, 'record' => (object) $sf]); } theme::portal_end(); echo '<br>'; theme::footer_start(); theme::footer_required(); theme::footer_button('submit'); theme::footer_end(); theme::form_end();