Thread: [Cppcms-users] load parameters and data initialization
Brought to you by:
artyom-beilis
From: mawan s. <ma...@gm...> - 2015-11-02 11:27:08
|
Dear All I want to create template menus. I create menu variable ( array),ini master content variable. I initialize menu data at application::init() void root_master::init() { ///PREPARE MAIN MENU prepare_menu(); I build menu from database, and store in content variable. Why variable is not reset after new request? In my case , in another request , there are accumulation menu item. request 1 = menu_a, menu_b request 2 = menu_a, menu_b, menu_a, menu_b should i use clear procedur to reset variable like database session variable? Thankyou Mawan [newbie] |
From: mawan s. <ma...@gm...> - 2015-11-02 11:38:09
|
It is similar pages variable in blog example. Please advice for best way load dynamic variables. Thanks . On Mon, Nov 2, 2015 at 6:26 PM, mawan sugiyanto <ma...@gm...> wrote: > Dear All > > I want to create template menus. I create menu variable ( array),ini > master content variable. I initialize menu data at application::init() > > > void root_master::init() > { > > ///PREPARE MAIN MENU > prepare_menu(); > > > I build menu from database, and store in content variable. Why variable is > not reset after new request? In my case , in another request , there are > accumulation menu item. > > request 1 = menu_a, menu_b > request 2 = menu_a, menu_b, menu_a, menu_b > > should i use clear procedur to reset variable like database session > variable? > > Thankyou > > > Mawan > [newbie] > |
From: Artyom B. <art...@ya...> - 2015-11-02 15:26:47
|
Did you define our content variables as class member. See cppcms::application class are reusable. They are stored in pool andused and created on demand. It is not created and destroyed per request, rather reused so I assume your menus are accumulated. Artyom Beilis From: mawan sugiyanto <ma...@gm...> To: cpp...@li... Sent: Monday, November 2, 2015 1:37 PM Subject: Re: [Cppcms-users] load parameters and data initialization It is similar pages variable in blog example. Please advice for best way load dynamic variables. Thanks . On Mon, Nov 2, 2015 at 6:26 PM, mawan sugiyanto <ma...@gm...> wrote: Dear All I want to create template menus. I create menu variable ( array),ini master content variable. I initialize menu data at application::init() void root_master::init() { ///PREPARE MAIN MENU prepare_menu(); I build menu from database, and store in content variable. Why variable is not reset after new request? In my case , in another request , there are accumulation menu item. request 1 = menu_a, menu_brequest 2 = menu_a, menu_b, menu_a, menu_b should i use clear procedur to reset variable like database session variable? Thankyou Mawan [newbie] ------------------------------------------------------------------------------ _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: mawan s. <ma...@gm...> - 2015-11-02 16:19:51
|
Yes, i use class for easy and manageable. And I pooled on the List. Like MVC approach iniJava orPHP. So, what is the best way, shoud i covert to structure? Or save it in cache? Or there are any function to execute that procedure? On Nov 2, 2015 10:28 PM, "Artyom Beilis" <art...@ya...> wrote: > Did you define our content variables as class member. > > See cppcms::application class are reusable. They are stored in pool and > used and created on demand. > > It is not created and destroyed per request, rather reused so I assume > your menus are accumulated. > > > Artyom Beilis > > ------------------------------ > *From:* mawan sugiyanto <ma...@gm...> > *To:* cpp...@li... > *Sent:* Monday, November 2, 2015 1:37 PM > *Subject:* Re: [Cppcms-users] load parameters and data initialization > > It is similar pages variable in blog example. Please advice for best way > load dynamic variables. > > Thanks . > > > > On Mon, Nov 2, 2015 at 6:26 PM, mawan sugiyanto <ma...@gm...> wrote: > > Dear All > > I want to create template menus. I create menu variable ( array),ini > master content variable. I initialize menu data at application::init() > > > void root_master::init() > { > > ///PREPARE MAIN MENU > prepare_menu(); > > > I build menu from database, and store in content variable. Why variable is > not reset after new request? In my case , in another request , there are > accumulation menu item. > > request 1 = menu_a, menu_b > request 2 = menu_a, menu_b, menu_a, menu_b > > should i use clear procedur to reset variable like database session > variable? > > Thankyou > > > Mawan > [newbie] > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |