Created
September 13, 2011 19:09
-
-
Save sergiopvilar/1214752 to your computer and use it in GitHub Desktop.
Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PainelController extends AppController { | |
var $name = "Painel"; | |
var $components = array('Auth','Session','Cookie'); | |
var $helpers = array('Html','Form','Session','Ajax','Paginator'); | |
var $uses = array('Publication','Account'); | |
function admin_index(){ | |
$this->set('title', 'Painel'); | |
// Publicações | |
$args_publication = array( | |
'conditions'=> array('publication.usuario_id'=>$this->Auth->User('id')) | |
); | |
$publications = $this->Publication->find('all',$args_publication); | |
$this->set('publications', $publications); | |
// Contas | |
$args_account = array( | |
'conditions'=> array('account.usuario_id'=>$this->Auth->User('id')) | |
); | |
$accounts = $this->Account->find('all',$args_account); | |
$this->set('accounts', $accounts); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment