0
顯示數據我想顯示從表games_reviews數據,而是我從桌上游戲中獲取數據,下面是控制器我使用CakePHP會不會從右表
class GamesReviewsController extends AppController {
var $uses = array('Game', 'GamesVideo', 'games_reviews', 'GamesVideosType', 'GamesRewiewTypes','GamesGenre','User');
public function view() {
//$this->layout = 'pages';
$this->set('columns', 1);
$url = $this->params['game_url'];
$game = $this->Game->findByUrl($url);
//render not found
$videos = Set::combine($game['GamesVideo'], '{n}.id', '{n}', '{n}.position');
if (!empty($game['Game']['amazon_iframe'])) {
$this->set('xtraDiv', array('Buy Game' => array('type' => 'iframe', 'content' => $game['Game']['amazon_iframe'])));
}
$this->set('game', $game);
$this->set('videos', $videos);
}
}
謝謝,我會做 – user974435