<?php use thom855j\PHPI18n\I18n, thom855j\PHPHtml\Form; ?> <h2 class="sub-header"><?php i18n::output('POST_UPDATE', $this->controller); ?> </h2> <?php foreach ($this->results->data as $view) { Form::start($this->current_url, "post", true); Form::label('title', i18n::get('POST_TITLE', $this->controller), "class='control-label'"); Form::input('text', 'title', $view->Title, "class='form-control'"); Form::label('start_date', i18n::get('POST_START', $this->controller), "class='control-label'"); Form::input('text', 'start_date', date($this->date_format, $view->Start_date), "class='form-control'"); Form::label('end_date', i18n::get('POST_END', $this->controller), "class='control-label'"); Form::input('text', 'end_date', date($this->date_format, $view->End_date), "class='form-control'"); Form::label('body', i18n::get('POST_CONTENT', $this->controller), "class='control-label'"); Form::textarea('body', " class='form-control'", $view->Body); foreach ($this->results->categories as $cat) { if (isset($this->results->post_cat)) { $extra = ''; foreach ($this->results->post_cat as $post_cat) { if ($post_cat->Cat_ID === $cat->ID) { $extra = "selected"; } } } if ($cat->Parent_ID == 0 || $cat->ID == $cat->Parent_ID) { $options[] = Form::options($cat->ID, '-' . $cat->Label, $extra); } else {
<?php use thom855j\PHPI18n\I18n, thom855j\PHPHtml\Form, thom855j\PHPHttp\Input; ?> <h2 class="sub-header"><?php i18n::output('POST_CREATE', $this->controller); ?> </h2> <?php Form::start($this->project_url, 'post', true); Form::label('title', i18n::get('POST_TITLE', $this->controller), "class='control-label'"); Form::input('text', 'title', Input::exists(Input::get('title')), "class='form-control' required"); Form::label('start_date', i18n::get('POST_START', $this->controller), "class='control-label'"); Form::input('text', 'start_date', date($this->date_format), "class='form-control' required"); Form::label('end_date', i18n::get('POST_END', $this->controller), "class='control-label'"); Form::input('text', 'end_date', null, "class='form-control' required"); Form::label('body', i18n::get('POST_CONTENT', $this->controller), "class='control-label'"); Form::textarea('body', " class='form-control'", Input::exists(Input::get('body'))); foreach ($this->results->categories as $cat) { if ($cat->Parent_ID == 0 || $cat->ID == $cat->Parent_ID) { $options[] = Form::options($cat->ID, '-' . $cat->Label); } else { $options[] = Form::options($cat->ID, $cat->Label); } } if (isset($this->results->uploads)) { $path = $this->project_url . '/public/uploads/thumbs/'; foreach ($this->results->uploads as $upload) { $selected = ''; $thumb = ''; foreach ($this->results->upload_item as $upload_item) {
<?php // load class require_once '../src/Form.php'; // use class use thom855j\PHPHtml\Form; // start a new form with action, method, // if it should parse files (set true) and exktra classes, attributes etc. Form::start($action, $method, $file_upload = null, $options = null); // add form label to form Form::label($for = 'id', $text = '', $options = null); // add input to form Form::input($type = 'text', $name = 'username', $value = null, $options = null); // add textarea to form Form::textarea($name = '', $options = null, $content = null); // end the form Form::end();