Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ini controlernya
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class Blog extends CI_Controller {
- function __construct()
- {
- parent::__construct();
- $this->load->model('M_Blog');
- }
- public function index()
- {
- $this->template->load('Backend/Layout','Backend/Content/v_Blog');
- }
- function new_Blog()
- {
- // $this->form_validation->set_rules('title', 'title', 'trim|required');
- // $this->form_validation->set_rules('content', 'content', 'trim|required');
- // $this->form_validation->set_rules('location', 'location', 'trim|required');
- // if ($this->form_validation->run() == false ) {
- // echo json_encode("wajib di isi");
- // } else {
- $data = array('title' => $this->input->post('title'),
- 'content' => $this->input->post('content'),
- 'location' => $this->input->post('location')
- );
- $object = $this->M_Blog->add_content($data);
- echo json_encode($object);
- //}
- }
- }
- /* End of file filename.php */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement