I've got some files that are really fat. For example, a products management area that has about 300 lines of code in the controller and 450 lines of code in the model. And it's only about half done.
I'd like to get some of this code out of my face. Anyone have recommendations?
I'm using the parser class with jade (which was just added last night).
I created in /app/classes/view/admin/login.php:
<?php
class View_Admin_Login extends ViewModel {
public function view()
{
$this->alternate_title = 'Testing this ViewModel thing';
}
}
And for my view file in /app/views/admin/login.jade
h2
= $alternate_title
h1
= $login
= $login_errors
= $login_form
I'm getting an undefined variable for $alternate_title. I tried setting the $_template property as well, above the view() function:
public $_template('login.jade')
Any ideas? Otherwise, are there any accepted conventions for abstracting some things away from my controllers and models, instead of the view?