试图学习PHP MVC。到目前为止,到目前为止这么好。我有这样的功能在我./controllers/index.phpPHP MVC呼叫控制器功能从视图
<?php
class Index extends Controller {
function __construct() {
parent::__construct();
}
function showFeeds() {
return 'done';
}
}
?>
我知道如何调用模型类和模型类运行showFeed()。我的问题是如何在我的./views/index.php上打印'done'。那有什么选择。
我已经尝试了下面列出的其中一些。但没有运气。
- 父:: showFeeds()
- $这 - >控制器 - > showFeeds();
为什么会您查看呼叫控制器上的方法? –
哪个框架是这个?codeigniter? –
我知道主意。我做了我认为正确的事情。我错了吗?有没有其他方法可以在我的./view/index.php中打印showFeed()返回值 – AmilaDG