Welcome Guest, Not a member yet? Register   Sign In
routes
#1

Hello,

I am trying to access views/blog_form.php but do not know what to type in the url to access that.  Can anyone explain how to?

I can access blog by typing localhost/blog but not the next one.


routes.php



PHP Code:
$route['default_controller'] = 'blog';
$route['blog_form'] = 'blog/blog_form'



controllers/Blog.php


PHP Code:
class Blog extends CI_Controller {

 
       public function index()
 
       {
 
               $this->load->model('blog_model');

 
               //$data['query'] = $this->blog->insert();

                
$data['title'] = $this->blog_model->select_blog();
                
$data['content'] = $this->blog_model->select_blog();
                
$data['date'] = $this->blog_model->select_blog();
                
                
$this->load->view('blog'$data);
                                            
                
//$this->load->view('blog');
 
       
        
}
        
        public function 
blog_form()
        {
                
$this->load->view('blog_form');
                                
        }

" If I looks more intelligence please increase my reputation."
Reply


Messages In This Thread
routes - by davy_yg - 04-21-2016, 12:31 AM
RE: routes - by paulkd - 04-21-2016, 12:39 AM
RE: routes - by davy_yg - 04-25-2016, 07:22 PM
RE: routes - by hipm - 04-25-2016, 09:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB