Welcome Guest, Not a member yet? Register   Sign In
Browser Back Button Question
#1

[eluser]Kraig[/eluser]
Why is it that when I move around through the CI view pages I made in my browser I cannot hit browser the back button? When I do it just sits there...
#2

[eluser]InsiteFX[/eluser]
Works for me! Check your code and browser settings
#3

[eluser]Kraig[/eluser]
Is there a setting, or...??

I did use .htaccess to get rid of index.php
#4

[eluser]CroNiX[/eluser]
CI has no control over the browsers back button.
#5

[eluser]InsiteFX[/eluser]
The browser back button keeps track of the page history and is internal to the browser!

So check your browser history settings...
#6

[eluser]Kraig[/eluser]
I think I might know what the problem is. I have a template that loads on every page.

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

<?php $this->load->view('includes/login'); ?>

<?php $this->load->view($main_content); ?>

<?php $this->load->view('includes/footer'); ?>

The header has the same title for every page...so my browser only keeps one instance of that Title in the history. Does CI have something so I can change the title in the header template section?

If not I guess I could create something in the config and call it with the title of each page.

Code:
$config['title_page'] = 'Home Page';

Then I could set it before the load of each page like so..
Code:
function index()
{
  $this->loggedin->adminLoggedIn();
  $this->config->set_item('title_page', 'Some New Page');
  
  $data['main_content'] = 'acp/continue_edit_user';
  $this->load->view('includes/template', $data);
}
#7

[eluser]CroNiX[/eluser]
Create a new variable in your header template for the title and pass it in from your controller?
#8

[eluser]Kraig[/eluser]
How would that be done?
Code:
<title><?php echo $title ?></title>

Then in the controller php file
Code:
function index()
{
  $title = "Home Page!!";
   $data['main_content'] = 'home';
   $this->load->view('includes/template', $data);

}

The variable shouldn't work like that
#9

[eluser]CroNiX[/eluser]
Nope, it won't work like that unless you pass it to the view like any other variable you pass to the view.

Code:
<title><?php echo $title ?></title>


Code:
function index()
{
   $data['title'] = "Home Page!!";  //put it in $data to pass to the view!!
   $data['main_content'] = 'home';
   $this->load->view('includes/template', $data);

}
#10

[eluser]robin hudda[/eluser]
Thanks for sharing this post with us .in this post we learn a lot of information from this post and this post make the beneficial to many of the visitor of this post.
Lne Consulting




Theme © iAndrew 2016 - Forum software by © MyBB