Preventing DRY in OOP |
[eluser]ivantcholakov[/eluser]
@behnampmdg3 This is what I would do: Code: class Base_Class extends CI_Controller { // Or MY_Controller Then within the ancestor controllers or views I would access needed data this way: Code: // Example 1 An amendment, using the helper, if it has been loaded: Code: <h1><?php echo registry('title'); ?></h1>
[eluser]behnampmdg3[/eluser]
@ivantcholakov I am not using library. I am using MY_Controller. In child, at the moment I do this: Code: class Account extends MY_Controller { Thanks
[eluser]InsiteFX[/eluser]
If you use either ivantcholakov's or my Registry then you should not have any problems, set the registry with your data then use the registry methods to call back the values. |
Welcome Guest, Not a member yet? Register Sign In |