[eluser]marcalj[/eluser]
Hello everybody!
I'm worried about the proceeding of loading views. I see that the loader is duplicating a lot of data in the proceeding.
I don't know exactly how internally PHP manage the memory. Probably would be better to use more references creating new variables or catching it in the function definition.
Example:
In Loader.php (page 551) replace
Code:
// Set the default data variables
foreach (array('view', 'vars', 'path', 'return') as $val)
{
$$val = ( ! isset($data[$val])) ? FALSE : $data[$val];
}
for
Code:
foreach( array('view', 'vars', 'path', 'return') as $val )
{
if( isset($data[$val]) )
{
$$val = &$data[$val];
}
else
{
$$val = FALSE;
}
}
Note the "&" for "linking" memory.
This is one example of how to increase performance. Do I am right?
I find confusing the loader method because in my controllers I send a lot of "memory" to views:
Code:
$this->load->view( "example_view", $this->vAlotOfData );
. I can access in views with "$this" and the separated variables... so I find strange the loader method.
What do you think?
Have a nice day