Welcome Guest, Not a member yet? Register   Sign In
CI Sample With Tank Auth Issues
#1

[eluser]Kebabman[/eluser]
Hi,

I've only just started with the CI framework and having an issue which has stumped me.

I have followed the sample in the CI user guide to get a basic controller and some views up and running. Simple controller as follows:

Code:
class Pages extends CI_Controller {

public function view($page = 'home')
{
  if ( ! file_exists('application/views/pages/'.$page.'.php'))
  {
   // Whoops, we don't have a page for that!
   show_404();
  }
  
  $data['title'] = ucfirst($page); // Capitalize the first letter

  $this->load->helper(array('form', 'url'));
  $this->load->library('form_validation');
  $this->load->library('security');
  $this->load->library('tank_auth');
  $this->lang->load('tank_auth');

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

This is all working ok showing the header, footer and pages. I have then installed the tank auth module. This works fine if I navigate to the pages using a url such as :

http://mysite.com/index.php/auth/register

However if I try to use one of the pages loaded from the pages controller and put in the following snippet of code I get some errors about undefined variables:

Code:
<?php
$this->load->view('auth/register_form');
?>

The variables that are undefined are ones declared within the tank auth config file. Can anyone give me any pointers about this? Not sure if it's relevant but my routes config is included below as well.

Code:
$route['auth/(:any)'] = 'auth/$1';
$route['auth'] = 'auth';
$route['(:any)'] = 'pages/view/$1';
$route['default_controller'] = 'pages/view';




Theme © iAndrew 2016 - Forum software by © MyBB