function index() { $this->session->set_userdata('MENU', MNU_COMPONENTS); $data = array(); $this->title = 'Form Components'; $this->libraries = get_libraries('formValidation', $data); $this->render('home/components', $data); }
function index() { $this->session->set_userdata('MENU', MNU_VALIDATION); $data = array(); $this->title = 'Form Validation'; $this->libraries = get_libraries('formValidation', $data); $this->render('home/validation', $data); }
function index() { $data = array(); $this->session->set_userdata('MENU', MNU_UPLOAD); $action = $this->input->post('action'); if (!empty($action) && $action == 'upload') { $this->load->library('upload'); $upload_config = $this->config->item('upload_config'); $this->upload->initialize($upload_config); if (!$this->upload->do_multi_upload("files")) { $error = array('error' => $this->upload->display_errors()); $data['error'] = $error; } else { $upload_data = $this->upload->get_multi_upload_data(); $data['upload_data'] = $upload_data; } } $this->title = 'File Upload'; $this->libraries = get_libraries('upload'); $this->render('home/upload', $data); }
function index() { $this->session->set_userdata('MENU', MNU_EDITOR); $this->load->helper('file'); $data = array(); $filename = 'data/article.txt'; $article_content = $this->input->post('article_content'); if (!empty($article_content)) { if (!write_file(FCPATH . $filename, $article_content)) { echo 'Unable to write the file'; } else { echo 'File written!'; } } if (file_exists(FCPATH . $filename)) { $data['article_content'] = file_get_contents(FCPATH . $filename); } $this->title = 'Web Editor'; $this->libraries = get_libraries('tinymce', $data); $this->render('home/editor', $data); }