Welcome Guest, Not a member yet? Register   Sign In
Getting object reference from load->library
#8

[eluser]WillKemp[/eluser]
[quote author="jhabbley" date="1238722112"]you do know what foo is when you load the library.

Code:
$this->load->library('email');
$data = array('email_object' => $this->email);
$this->parser->parse('someview', $data);

"$this->email" is the object instance of the email library that you loaded.[/quote]

Yeah, of course. Sorry, i was getting confused there. I need to have several instances of the object at the same time, so i'd need to use the third parameter to $this->load->library() to give each object a different name. It's that name i don't know.

e.g.,

Code:
include( 'Aliasformfield.php' );
$aliasObjs = array();
$aliases = $this->dbfetch->aliases( $id );
$i = 0;
foreach ( $aliases as $alias )
{
    $params = array(
        'id' => $alias->aliasId
        , 'forename' => $alias->forename
        , 'surname' => $alias->surname
        );
    $aliasObjs[$i] = new aliasformfield( $params );
    $i++;
}

How can i do that using $this->load->library() instead of 'new'?


Messages In This Thread
Getting object reference from load->library - by El Forum - 04-02-2009, 12:00 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 12:21 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 01:03 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 01:06 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 01:14 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 01:22 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 02:28 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 02:43 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 02:45 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 02:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB