Welcome Guest, Not a member yet? Register   Sign In
Newsletter Application
#5

[eluser]dedenf[/eluser]
sorry for my bad english Big Grin
if i wrote the code, it maybe turns out like this
Code:
<?php
class Main extends Controller{
    function Main(){
        parent::constructor();
        /* other library */
        $this->load->model('poll');
        $this->load->model('article');
        $this->load->model('caption');
    }

    function index(){
        $data['poll'] = $this->poll->display();
        $data['article'] = $this->article->display();
        $data['caption'] = $this->caption->display();
        $this->load->view('my_view',$data);
    }
    
    //$modelname, or anything that contain the poll,article or caption parameter
    function edit($modelname, $rec_id)
    {
        switch($modelname){
            case 'poll':
              $this->poll->edit($rec_id, $value); // or anything
            break;
        .........
        }
    }
    ...........
}
?>
just my thought, maybe the other can give you better suggestions


Messages In This Thread
Newsletter Application - by El Forum - 08-29-2007, 05:06 PM
Newsletter Application - by El Forum - 08-30-2007, 02:09 AM
Newsletter Application - by El Forum - 08-30-2007, 02:21 AM
Newsletter Application - by El Forum - 08-30-2007, 03:08 AM
Newsletter Application - by El Forum - 08-30-2007, 06:29 AM
Newsletter Application - by El Forum - 08-30-2007, 07:18 AM
Newsletter Application - by El Forum - 08-30-2007, 08:05 AM
Newsletter Application - by El Forum - 08-30-2007, 08:44 AM
Newsletter Application - by El Forum - 08-30-2007, 09:51 AM
Newsletter Application - by El Forum - 08-30-2007, 10:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB