CodeIgniter Forums
How to change data which is init by autoloader? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: How to change data which is init by autoloader? (/thread-40415.html)



How to change data which is init by autoloader? - El Forum - 04-07-2011

[eluser]liren[/eluser]
Hello friends:

I initialize a tree object using autoloader.I want to using this tree structure in many models in my app.My problem is that how to change this tree object? My users want to change data and structure of this tree. How to get this tree object and change it?Thanks!


How to change data which is init by autoloader? - El Forum - 04-07-2011

[eluser]toopay[/eluser]
configure some 'pre_controller' hook to handle that.


How to change data which is init by autoloader? - El Forum - 04-07-2011

[eluser]liren[/eluser]
[quote author="toopay" date="1302251795"]configure some 'pre_controller' hook to handle that.[/quote]

Thank you toopay:

But what I want to do is change global value which is initialize by autoloader.otherthan change the value before I call a controller.
For example,I autoload a $var="hello" to memory,how to change the value of $var while system running?
I initial a tree class on app started. This tree is a menu structure.Web administrator could edit the menu structure in app console. So I want to know how to do it. Thanks´╝ü


How to change data which is init by autoloader? - El Forum - 04-07-2011

[eluser]toopay[/eluser]
What type resource which you load by autoloader? config, package, helper or library?


How to change data which is init by autoloader? - El Forum - 04-07-2011

[eluser]liren[/eluser]
[quote author="toopay" date="1302259581"]What type resource which you load by autoloader? config, package, helper or library?[/quote]

Hi toopay:

I want to autoload an array data when webapp start. the array data like this:

Code:
$arr = array(
    'menu1' => 'home page',
    'menu2' => 'cms page',
    $arr = array(
        'menu2_1' => 'cms_admin',
        'menu2_2' => 'cms_console',
        'menu2_3' => 'cms_view',
        'menu2_4' => 'cms_layoutadmin'
    ),
    'menu3' => 'forum'
);
How to put this data to memory when webapp start? [email protected]


How to change data which is init by autoloader? - El Forum - 04-08-2011

[eluser]toopay[/eluser]
i give some example on [url:ellislab.com/forums/viewthread/185924/]your other thread[url]


How to change data which is init by autoloader? - El Forum - 04-08-2011

[eluser]toopay[/eluser]
[url:ellislab.com/forums/viewthread/185924/]your other thread[/url]


How to change data which is init by autoloader? - El Forum - 04-08-2011

[eluser]toopay[/eluser]
[url http://ellislab.com/forums/viewthread/185924/]your other thread[url]


How to change data which is init by autoloader? - El Forum - 04-08-2011

[eluser]toopay[/eluser]
:coolmad: sorry for that unreadable link. Here