Welcome Guest, Not a member yet? Register   Sign In
having trouble with controllers
#1

[eluser]bradyrose[/eluser]
Hey guys. Ok.. so to start, im just barely proficient at php , so codeigniter has been a bit of a challenge.. I have appropriated code from a tutorial online to get my main page to display the index by default, and then display pages from within a folder in the views named 'pages' if there is a corresponding page name, ie, faq, about, account, etc.

ok.. so this was all well and working, however for some reason when i create a new public function, i can't get it to display to screen. ultimately my goal is so that I can load a third party app when i go to something particular like, index.php/pmsystem

perhaps im using the wrong path, or perhaps my previous code is somehow interfearing with the pubic function displaying... whatever it is I am stumped.


Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');


class Pages extends CI_Controller {

public function index()
{
  $this->load->view('index');
}




public function view($page = 'home')
    {

// show an error ir the page doesnt exist for some reason  
if ( ! file_exists('application/views/pages/'.$page.'.php'))
  {
  // Whoops, we don't have a page for that!
  show_404();
  }
  
//Capitalize the first letter of the title
$data['title'] = ucfirst($page);

// load all the helpers and libraries to be used  

$this->load->library('session');
$this->load->database();
$this->load->library('table');
$this->load->library('pagination');
$config['base_url'] = 'http://www.cashforbtc.com/index.php/feedback';
$config['total_rows'] = 300;
$config['per_page'] = 3;
$this->pagination->initialize($config);
$this->load->helper('url');
$this->load->helper('form');
$this->load->helper('captcha');

// load all the sections of the page

$this->load->view('templates/header', $data);
$this->load->view('templates/navbar', $data);
$this->load->view('pages/'.$page, $data);
$this->load->view('templates/footer', $data);

}

public function pmsystem()
{
echo "why does this not display?";
}

}


Messages In This Thread
having trouble with controllers - by El Forum - 07-20-2012, 08:33 PM
having trouble with controllers - by El Forum - 07-20-2012, 11:59 PM
having trouble with controllers - by El Forum - 07-21-2012, 02:19 AM
having trouble with controllers - by El Forum - 07-21-2012, 03:50 AM
having trouble with controllers - by El Forum - 07-21-2012, 10:50 AM
having trouble with controllers - by El Forum - 07-21-2012, 11:05 AM
having trouble with controllers - by El Forum - 07-21-2012, 04:53 PM
having trouble with controllers - by El Forum - 07-21-2012, 06:45 PM
having trouble with controllers - by El Forum - 07-22-2012, 07:01 PM
having trouble with controllers - by El Forum - 07-22-2012, 11:37 PM
having trouble with controllers - by El Forum - 07-23-2012, 03:23 PM
having trouble with controllers - by El Forum - 07-23-2012, 03:42 PM
having trouble with controllers - by El Forum - 07-23-2012, 05:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB