在 kohana 中找不到请求的视图 1.php
我正在尝试学习 kohana 框架。 我在应用程序/控制器/类下定义了一个新的控制器。我将其命名为 hello.php:
class Controller_Hello extends Controller
{
public function action_say(){
$g = new View('firstv');
$g->render(TRUE);
}
}
?>
我在应用程序/视图下有这个。我称之为firstv.php:
<h1>testing1</h1>
这里有什么错误。我正在使用本指南: http://pixelpeter.com/kohana/kohana101.pdf
我正在使用最新的稳定版本3.1.3.1.我通过导航到以下位置来调用该函数: http://localhost/kohana/index.php/hello/say
尝试使用同样的说功能。它起作用了。但这个不使用视图。
$this->response->body('hello, world 2!');
请帮忙,谢谢。
I'm trying to learn the framework kohana.
I have defined a new controller under application/controller/classes. Which I named to hello.php:
class Controller_Hello extends Controller
{
public function action_say(){
$g = new View('firstv');
$g->render(TRUE);
}
}
?>
And I have this under application/views. Which I called firstv.php:
<h1>testing1</h1>
What's the mistake here. I'm using this guide:
http://pixelpeter.com/kohana/kohana101.pdf
I'm using the latest stable version 3.1.3.1. I have called the function by navigating to:
http://localhost/kohana/index.php/hello/say
Tried this using the same say function. And it worked. But this one doesn't use views.
$this->response->body('hello, world 2!');
Please help, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,您的完整操作方法将类似于:
或:
甚至:
So your complete action method will be something like:
or:
or even: