HMVC View Partials - Best Practices |
[eluser]ilumos[/eluser]
Hi Guys, I'm using Wiredesignz's HMVC extension with CI 2.1.2 and I'm sure there's a better way to render view partials than how I'm doing things. I feel I'm repeating too much code, and making my modules not re-usable. Any comments/suggestions welcomed. Code: \application application/modules/user/controllers/user.php: Code: class User extends MX_Controller { application/modules/user/views/profile.php: Code: <h1><?php echo $user_info['username']; ?></h1> application/views/container.php: Code: <!DOCTYPE html> Many thanks in advance
[eluser]ZaLiTHkA[/eluser]
Why don't you put your common functions into a different module and run them with this: Code: Modules::run('module/controller/method', $param, $...); I get the idea that's going to give you the DRY idea you're looking for here. Have a look at the BitBucket HMVC wiki page for more defails. |
Welcome Guest, Not a member yet? Register Sign In |