Controller for home page

edited May 2015 in Installation
Hi!
I want to use controller for my home page, for this I changed in file routes.php default_controller at "home", created controller in file controllers/home.php with code:
... public function _remap() { $data['layout'] = 'my_home_page'; $data['slides'] = $this->action_model->get_all_active_slides(); $this->fuel->pages->render('home', $data); }
in file _layouts/my_home_page.php I got this:
<?php $this->load->view('_blocks/header')?> <div class="container main_inner"> <h1>Home page</h1> <?php echo fuel_var('body', 'Controller home page'); ?> <?php echo $slides; ?> </div> <?php $this->load->view('_blocks/footer')?>
I get the contents of the $slides, and interesting thing, fuel_var('body') returns the contents of the file views/home.php.
in file views/home.php I got just some text.
The problem appeared when changed language of the site (language_mode = 'segment'), if site url is my_site.com/de - I get only contents of the file views/home.php, tell me what could be wrong?
And by the way, I have long been interested in question, what is the best way to make controller responsible for displaying the home page?

Comments

  • edited 12:30PM
    If you want your home controller to handle the /de segment, then you'll need to create a route for it in the fuel/application/config/routes.php file.

    Regarding your question about the best way to make a controller responsible for displaying the homepage, the way you have set it up.
Sign In or Register to comment.