Welcome Guest, Not a member yet? Register   Sign In
[Free Css Templates] combination of menu and the sidebar does not work
#2

[eluser]d1d1[/eluser]
- Aplication/controller/pages.php
Code:
<?php
class Pages extends CI_Controller{
public function view($page = 'home')
{
  if(!file_exists('application/views/pages/'.$page.'.php'))
  {
    //up.. tidak ada halaman yang anda minta!
    show_404();
  }
  
  $data['title'] = ucfirst($page); //dek taok kenen
  
  //$this->load->view('pages/home');
  $this->load->view('templates/header',$data);
  $this->load->view('pages/'.$page,$data);
  $this->load->view('templates/footer',$data);
}


}

- Aplication/models/news_model.php
Code:
<?php
class News_model extends CI_Model {

public function __construct()
{
  $this->load->database();
}

public function get_news($slug = FALSE)
{
  if($slug === FALSE)
  {
   $query = $this->db->get('news');
   return $query->result_array();
  }
  
  $query = $this->db->get_where('news', array('slug' => $slug));
  return $query->row_array();
}

public function set_news()
{
$this->load->helper('url');

$slug = url_title($this->input->post('title'), 'dash', TRUE);

$data = array(
  'title' => $this->input->post('title'),
  'slug' => $slug,
  'text' => $this->input->post('text')
);

return $this->db->insert('news', $data);
}
}


Messages In This Thread
[Free Css Templates] combination of menu and the sidebar does not work - by El Forum - 04-26-2012, 11:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB