Welcome Guest, Not a member yet? Register   Sign In
Linking to a Page
#1

[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="&lt;?php echo site_url('about') ?&gt;">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...


Messages In This Thread
Linking to a Page - by El Forum - 12-09-2012, 03:21 PM
Linking to a Page - by El Forum - 12-09-2012, 03:30 PM
Linking to a Page - by El Forum - 12-09-2012, 03:43 PM
Linking to a Page - by El Forum - 12-09-2012, 04:15 PM
Linking to a Page - by El Forum - 12-09-2012, 05:24 PM
Linking to a Page - by El Forum - 12-09-2012, 08:13 PM
Linking to a Page - by El Forum - 12-10-2012, 06:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB