Welcome Guest, Not a member yet? Register   Sign In
Redundant data control in Controller, How!!!
#1

[eluser]Unknown[/eluser]
I am new to CI,

This is my code
Code:
<?php
class Home extends Controller {
    
    /**
     *
     * Enter description here ...
     */
    function __construct() {
        parent::Controller();
    }
    
    /**
     *
     * Enter description here ...
     */
    function index() {
        
        $data = "";
        $data['view_pagetitlebar'] = "Welcome | Muhammad Ahmed";
        $data['view_metadata'] = "metadata";
        $data['view_stylesheet'] = "css style sheet";
        $data['view_navlinks'] = "nav links";
        $data['view_pagetitle'] = "asd";
        
        $data['view_contents_left'] = "Left side content";
        $data['view_footer'] = "Footer";
        
        
        $data['view_contents_right'] = "This is the home page";
        
        $this->load->view('view_main', $data);
        
    }
    
    /**
     *
     * Enter description here ...
     */
    function about() {
        
        $data = "";
        $data['view_pagetitlebar'] = "Welcome | Muhammad Ahmed";
        $data['view_metadata'] = "metadata";
        $data['view_stylesheet'] = "css style sheet";
        $data['view_navlinks'] = "nav links";
        $data['view_pagetitle'] = "asd";
        
        $data['view_contents_left'] = "Left side content";
        $data['view_footer'] = "Footer";
        
        
        $data['view_contents_right'] = "This is the about page";
        
        $this->load->view('view_main', $data);
        
    }
}

we can see each time maximum data remains the same, only 'view_contents_right' is different in each function.

If i made a new function or any new controller i need to paste all the data again with update 'view_contents_right' data...
Can we controller this redundant data..

Any link, or any thing that can help me...

Thanks,
Muhammad Ahmed


Messages In This Thread
Redundant data control in Controller, How!!! - by El Forum - 08-26-2010, 09:39 AM
Redundant data control in Controller, How!!! - by El Forum - 08-26-2010, 01:07 PM
Redundant data control in Controller, How!!! - by El Forum - 08-27-2010, 03:17 AM
Redundant data control in Controller, How!!! - by El Forum - 08-28-2010, 11:18 AM
Redundant data control in Controller, How!!! - by El Forum - 08-28-2010, 03:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB