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

[eluser]bradyrose[/eluser]
i have checked config.php and found the settings to match as you have stated,

I have put .htaccess files in both the application directory and the home directory, because I am unsure where it should be placed. Should it be the code you provided alone?

I have posted simply the information you have supplied within the .htaccess file and have attempted urls such as www.cashforbtc.com/pages/home, which yields "not found" pages.

however, www.cashforbtc.com/index.php/home , and other corresponding pages still work.

pages.php controller:

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);

}

}



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