Skip to content

Commit

Permalink
extending AppController for all controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
josegonzalez committed Apr 25, 2011
1 parent a9ede11 commit 4b92154
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
9 changes: 9 additions & 0 deletions controllers/app_controller.php
@@ -0,0 +1,9 @@
<?php
class AppController extends Controller {

protected function beforeFilter() {
Git::loadRepositories();
System::set('title', $this->_request->params['project']);
}

}
8 changes: 1 addition & 7 deletions controllers/commits_controller.php
@@ -1,18 +1,12 @@
<?php

class CommitsController extends Controller {

protected function beforeFilter() {
Git::loadRepositories();
}
class CommitsController extends AppController {

public function index() {
$this->_breadcrumbs = array(
'home' => '/',
$this->_request->params['project'] => "/{$this->_request->params['project']}",
);

System::set('title', $this->_request->params['project']);
$owner = $this->Project->getOwner($this->_request->params['project']);
$last_change= $this->Project->getLastChange($this->_request->params['project']);
$description= $this->Project->getDescription($this->_request->params['project']);
Expand Down
3 changes: 1 addition & 2 deletions controllers/home_controller.php
@@ -1,6 +1,5 @@
<?php

class HomeController extends Controller {
class HomeController extends AppController {

public function index() {
System::set('title', 'Home');
Expand Down

0 comments on commit 4b92154

Please sign in to comment.