mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-22 12:29:11 -04:00
Normalize our Admin controllers so that functions always print out
their results, as opposed to having them return their view back upstream. This is a little more code in every controller, but it's much less magical and more consistent. Look up the active_theme and active_admin_theme inside the view itself, no need to do that in the controllers. This makes view initialization easier in the controllers.
This commit is contained in:
@@ -19,9 +19,10 @@
|
||||
*/
|
||||
class Admin_Users_Controller extends Controller {
|
||||
public function index() {
|
||||
$view = new View("admin_users.html");
|
||||
$view->users = ORM::factory("user")->find_all();
|
||||
return $view;
|
||||
$view = new Admin_View("admin.html");
|
||||
$view->content = new View("admin_users.html");
|
||||
$view->content->users = ORM::factory("user")->find_all();
|
||||
print $view;
|
||||
}
|
||||
|
||||
public function edit($id) {
|
||||
@@ -40,6 +41,8 @@ class Admin_Users_Controller extends Controller {
|
||||
url::redirect("admin/users/edit/$id");
|
||||
}
|
||||
|
||||
return $form;
|
||||
$view = new Admin_View("admin.html");
|
||||
$view->content = $form;
|
||||
print $view;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user