[eluser]bjuneau[/eluser]
Me again... Still trying to wrap my designer brain around how to link to pages... Thank you again for all the help. I'm slowly "getting it" as I work with it... However, I've seemed to have run into a simple but possibly complex problem.
What I am trying to do is simply link to another page from a page.
Note: I am using AG Auth with my process...
Code:
// My "routes.php":
$route['default_controller'] = "admin/admin";
$route['scaffolding_trigger'] = "";
// BEGIN AUTHENTICATION LIBRARY ROUTES
$route['login'] = "admin/admin/login";
$route['logout'] = "admin/admin/logout";
$route['register'] = "admin/admin/register";
$route['admin/dashboard'] = "admin/admin/index";
// END AUTHENTICATION LIBRARY ROUTES
Code:
// My controller "admin.php":
<?php
class Admin extends Application
{
public function __construct()
{
parent::__construct();
}
public function index()
{
if(logged_in())
{
$this->ag_auth->view('dashboard');
}
else
{
$this->login();
}
}
}
// Location: application/controllers/admin/dashboard.php
Code:
// My index.php:
<?php
$this->load->view($this->config->item('auth_views_root') . 'header');
if(isset($data))
{
$this->load->view($this->config->item('auth_views_root') . 'pages/'.$page, $data);
}
else
{
$this->load->view($this->config->item('auth_views_root') . 'pages/'.$page);
}
$this->load->view($this->config->item('auth_views_root') . 'footer');
?>
Code:
// My directory structure for Views is:
- (dir) views
-- (dir) auth
-- (file) header.php
-- (file) footer.php
--- (dir) pages
--- (file) dashboard.php (I want to link to about.php via <a href="about.php">About</a>)
--- (file) about.php
What I've tried:
Code:
<a href="<?php echo site_url('about') ?>">About</a>
When using the above I get "Page Not Found" but when I switch out "about" with an existing page (e.g. register) it works...