Welcome Guest, Not a member yet? Register   Sign In
Problem with URL
#1

[eluser]The Beginner[/eluser]
Hi guy's, I have gotten my main index page finished and it is working great finnally. Now I am building content pages and am having problems getting the content data to load. My Controller code is below. I am using a view file called wpContainer.php to display all pages. I am loading my content data in a model file. When the menu item for streetrods is clicked my URL is changing accordingly but the function that loads the new content data never gets called.
URL when the app starts is "http://localhost/index.php"
when the menu item is clicked the url changes to: "http://localhost/index.php/wpapp/streetrods/"

Code:
<?php
class Wpapp extends Controller {
    function Wpapp()
    {
         parent::Controller();
        $this->load->helper('url');
        $this->load->helper('form');
        $this->load->helper('html');  
    }
    function streetrods()
    {
        $content_data = '';
        $this->load->Model('wp_page_model');  
        $data = $this->wp_page_model->getHeaderData();
        $pagename = '"StreetRods"';
        $active = '1';
        $data['content_data'] = $this->wp_page_model->getContentData($pagename,$active);    
    //    $data['right_data'] = $this->wp_page_model->getRightPaneData();    
        $data['right_data'] = '';
        $data['menu'] = $this->wp_page_model->getMenuData();
        $data['footer'] = '';
        $data['test'] = 'This is a test to see if this function is being called or not......';
        $this->load->view('wpContainerTest',$data);        
    }
    function index()
    {   //Get the data for the page header (logo, site tittle & text);
        $this->load->Model('wp_page_model');  
        $data = $this->wp_page_model->getHeaderData();
        $pagename = '"MainPage"'; //if I change this to '"StreetRods"' it loads the street rods data
        $active = '1';
        $data['content_data'] = $this->wp_page_model->getContentData($pagename,$active);    
        $data['right_data'] = '';
        $data['menu'] = $this->wp_page_model->getMenuData();
        $data['footer'] = '';
        $data['test'] = 'The test is on....';
        $this->load->view('wpContainerTest',$data);
    }
}
/* End of file wpApp.php */
/* Location: ./wpapp/controllers/wpApp.php */

Any suggestions would be greatly appreciated
Thanks,
Del

?>


Messages In This Thread
Problem with URL - by El Forum - 10-03-2009, 09:52 AM
Problem with URL - by El Forum - 10-03-2009, 10:21 AM
Problem with URL - by El Forum - 10-04-2009, 09:32 AM
Problem with URL - by El Forum - 10-04-2009, 09:47 AM
Problem with URL - by El Forum - 10-04-2009, 10:10 AM
Problem with URL - by El Forum - 10-04-2009, 12:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB