Welcome Guest, Not a member yet? Register   Sign In
Preventing DRY in OOP
#8

[eluser]behnampmdg3[/eluser]
Thanks.

It's working. The reason it was NOT working is that my computer strangely caches a lot of stuff!


Anyways, it is working now. Yest another question.

I still repeat some code in most controllers:

Code:
$data['page_title'] = "My Account - ";
   $data['ad_without_photo_found']=$this->ad_without_photo_found;
   $data['unread'] = $this->unread;
   $data['logged_user']=$this->logged_user;
   $data['my_haves'] = $this->my_haves;
   $data['need_membership'] = $this->need_membership;
   $data['notifications'] = $this->notifications;
   $data['show_contact_details'] = $this->show_contact_details;
   $data['update_message']='';
   $data['need_membership'] = $this->need_membership;
   $data['unread_menu_message'] = $this->unread_menu_message;

How can I move them to somewhere so in case I need to chage I won't have to change them in every single controller?

Thanks


Messages In This Thread
Preventing DRY in OOP - by El Forum - 01-09-2014, 05:44 AM
Preventing DRY in OOP - by El Forum - 01-09-2014, 10:01 AM
Preventing DRY in OOP - by El Forum - 01-09-2014, 10:33 AM
Preventing DRY in OOP - by El Forum - 01-10-2014, 01:41 AM
Preventing DRY in OOP - by El Forum - 01-10-2014, 05:22 AM
Preventing DRY in OOP - by El Forum - 01-10-2014, 10:11 AM
Preventing DRY in OOP - by El Forum - 01-10-2014, 02:12 PM
Preventing DRY in OOP - by El Forum - 01-11-2014, 05:12 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 05:44 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 05:54 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 06:09 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 06:10 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 06:13 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 06:17 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 06:29 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 06:33 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 07:49 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 07:51 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 07:54 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 09:16 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 09:58 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 06:09 PM
Preventing DRY in OOP - by El Forum - 01-12-2014, 05:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB