MVC: The MODEL retrieves the data (business logic).
The CONTROLLER sets the data for the view [$this->set()].
The VIEW simply handles your output, and any logic that is not capable of being handled elsewhere.
Using Cake convention based on how the cake bake
output is created, you'd want to set the ORDER BY clause in the call to the model's find() method in your controller, related to the particular view. In this case, your Department's add() method.
public function add(){
// ... other code ...
$users = $this->Department->User->find('list', array('order' => array('lastName' => 'asc'));
$this->set(compact('users'));
}
Be aware that if you are using the Containable Behavior you may need to adjust its settings to achieve the default (most likely working) code example above.