Redirection in CodeIgniter

2

I'm developing a project using the framework codeigniter.

In% of the rendering of the site, I would like to first direct to a folder called 'input', and clicking a link in this folder will then enter the 'site' folder, which in this case is the default folder .

My question is: If I put a index with a redirect in javascript , it will not work because the main one is php >, and if I change php , it will not open the site on the click.

What do you suggest?

    
asked by anonymous 03.08.2015 / 21:27

1 answer

2

To create the modal, do the following:

  • Pass a parameter to the view indicating whether to display a modal
  • In the view check the value of this variable, and if the value is positive (true) add the modal content;
  • Use this same variable to add a javascript code to display the modal.
  • It would look something like this:

  • No controller
  • $this->load->view('minha_view', array('exibirModal' => TRUE));
  • In view - modal content
  • <?php
            if ($exibirModal) {
                
        ?>
            <!-- 
              Aqui vai o modal
              Como montar um modal BS: http://getbootstrap.com/javascript/#modals
            -->
            <div id="modal"></div>
        <?php
            }
        ?>
  • In the view - modal view
  •  <?php
            if ($exibirModal) {
                <!-- Aqui vai o modal -->
        ?>
                <script>
                    $('#modal').modal();
                </script>
        <?php
            }
        ?>

    This should already meet your need.

        
    03.08.2015 / 21:40