[eluser]Doodlez[/eluser]
I have a certain number of elements that are going to be called on my page over and over again. I planned on extending the controller class with functions that generate the elements.
For example my header is static with a few small changes....
Code:
<?php
class Legos extends Controller{
function Legos(){
parent::Controller();
}
function head(){
$this->load->helper('url');
$this->load->helper('html');
$header['navLink']=array(anchor('main','Home'),anchor('events','Events'),anchor('contact','Contact'),anchor('submissions','Submissions'));
$decleration['title']='jagazineDream';
$decleration['meta']=array('name'=>'robots','content'=>'taking over the world');
$this->load->view('decleration',$decleration);
$this->load->view('header',$header);
}
}
?>
and then any time I needed my header I can call it ............
Code:
<?php
class Main extends Legos
{
function index()
{
parent::head();
}
}
?>
my plan is to just create the other elements of my page as functions and just keep extending the controller class. I have never really done any object based programming I kind of guessed my way. Is there any where I will get my self in trouble creating a site like this?