Welcome Guest, Not a member yet? Register   Sign In
loading helpers in a loop
#1

[eluser]xmonader[/eluser]
Hi, I'm trying to load helpers marked as "active_plugin" in the database settings

Code:
function load_activeplugins(){
        $activeps=$this->Settings_model->getActivePlugins();
        print_r($activeps);
        $helpers=array();
        foreach($activeps as $row){
            $pfullname=$row->setting_key;
            $pparts=explode("_", $pfullname);
            $pname=$pparts[0];
            $hname="myhelpers/$pname";
            $helpers[]=$hname;
        }
        print_r($helpers);
        $this->load->helper($helpers); // array supported by MY_Loader MS
    }

The result:
Quote:Array ( [0] => stdClass Object ( [setting_id] => 18 [setting_key] => censoring_helper [setting_value] => active_plugin ) [1] => stdClass Object ( [setting_id] => 19 [setting_key] => youtube_helper [setting_value] => active_plugin ) )
Array ( [0] => myhelpers/censoring [1] => myhelpers/youtube )

If I use
Code:
//$this->load->helper("myhelpers/youtube"); #THIS LINE WORKS
the youtube helper gets loaded. What's wrong ?


Messages In This Thread
loading helpers in a loop - by El Forum - 05-11-2010, 11:22 PM
loading helpers in a loop - by El Forum - 05-12-2010, 02:14 AM
loading helpers in a loop - by El Forum - 05-12-2010, 03:04 AM
loading helpers in a loop - by El Forum - 05-12-2010, 03:11 AM
loading helpers in a loop - by El Forum - 05-12-2010, 03:26 AM
loading helpers in a loop - by El Forum - 05-12-2010, 03:32 AM
loading helpers in a loop - by El Forum - 05-12-2010, 03:38 AM
loading helpers in a loop - by El Forum - 05-12-2010, 04:49 AM
loading helpers in a loop - by El Forum - 05-12-2010, 05:01 AM
loading helpers in a loop - by El Forum - 05-12-2010, 06:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB