cakephp 从另外一个页面读取数据

$comments = $this->requestAction('/comments/latest');
foreach ($comments as $comment) {
    echo $comment['Comment']['title'];
}
echo $this->requestAction(
    array('controller' => 'articles', 'action' => 'featured'),
    array('return')
);

这种方式,可以直接返回一个变量或者对象,也可以返回一个html渲染的结果用于现实在页面上

原文地址:https://www.cnblogs.com/linksgo2011/p/3064443.html