Welcome Guest, Not a member yet? Register   Sign In
if page is equal to home
#4

[eluser]ppwalks[/eluser]
Whats the reason for this, i'm struggling to understand your logic, if you want a process on the home page create a model and load it then call it on the view, sorry just not quite getting what your after.

Are you on about using the index.php as a controller and switching templates from there if so you would have something like this:

Controller

Code:
$data['main'] = 'home';
  $this->load->vars($data);
  $this->load->view('index');

index.php

Code:
<?php $this->load->view("main/".$main); ?>

then you can switch the pages:

So for the first example it will load home.php through $main declared in ['main']

You would then load a function from the model to do what you want on the homepage - so say you want a random feature to display you would then:

Code:
$data['your_variable_to_load_to_view'] = $this->ModelName->ModelFunction();

Then that will run any logic you want if its unique to the home page

Is this correct?


Messages In This Thread
if page is equal to home - by El Forum - 04-25-2012, 04:13 AM
if page is equal to home - by El Forum - 04-25-2012, 05:51 AM
if page is equal to home - by El Forum - 04-25-2012, 05:57 AM
if page is equal to home - by El Forum - 04-25-2012, 06:11 AM
if page is equal to home - by El Forum - 04-25-2012, 06:13 AM
if page is equal to home - by El Forum - 04-25-2012, 06:23 AM
if page is equal to home - by El Forum - 04-25-2012, 06:26 AM
if page is equal to home - by El Forum - 04-25-2012, 06:29 AM
if page is equal to home - by El Forum - 04-25-2012, 06:30 AM
if page is equal to home - by El Forum - 04-25-2012, 06:34 AM
if page is equal to home - by El Forum - 04-25-2012, 06:41 AM
if page is equal to home - by El Forum - 04-25-2012, 06:46 AM
if page is equal to home - by El Forum - 04-25-2012, 11:22 AM
if page is equal to home - by El Forum - 04-25-2012, 11:39 AM
if page is equal to home - by El Forum - 04-25-2012, 11:45 AM
if page is equal to home - by El Forum - 04-25-2012, 11:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB