TinyMVC始终显示“默认"控制器

编程入门 行业动态 更新时间:2024-10-21 03:58:27
本文介绍了TinyMVC始终显示“默认"控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直在跟踪文档,直到最后,用smarty测试了一个html模板,然后将其剪切了.然后我发现控制器无法按预期工作-例如,我在myapp/conrollers,'hello.php'中创建的任何名称都包含docs中描述的类. e.

I was following documentaion till the end, tested one html template with smarty and then cut it. Then I found out that controllers do not work as expected – whatever name I create in myapp/conrollers, 'hello.php' for example, that contains class described in docs, i. e.

class Hello_Controller extends TinyMVC_Controller { function index() { echo "Hello World."; } function time() { echo "The time is now."; } }

我无法显示.因此,文件名是控制器类名的前缀,在这里似乎一切正常,但是转到/index.php/hello将返回'default.php'中的内容.我什至尝试通过设置$config['default_controller']在myapp/configs/application.php中将默认控制器更改为"hello",但是该框架的行为就像始终与"default.php"一起使用时一样.屏幕或日志中没有错误(我检查了Web服务器和解释器的配置中的每个选项两次),我完全不知道该怎么办,我什至不能在其论坛上写因为要等待几天的行政审批".

I can’t show it. So the name of the file is a prefix for the controller class name, all seems to be ok here, but going to /index.php/hello returns what is in 'default.php'. I’ve even tried to change default controller to 'hello' in myapp/configs/application.php by setting $config['default_controller'], but the framework behaves like if it’s always work with the 'default.php'. There is no errors on screen or in logs (I checked twice every option in configs of my web server and interpreter), I totally don’t know what to do with that goddamn piece of crap, I can’t even write on its forum because waiting for ‘administration approval’ for several days.

推荐答案

我不得不深入研究框架以找到答案.当它检查控制器文件时,它使用file_exists()而不考虑包含路径.谷歌搜索"TinyMVC + file_exists"使我链接到该主题,其中写道他们已将其修复为SVN版本.

I had to dig inside of the framework to find an answer. And it is when it checks for a controller file it uses file_exists() which do not respect include path. Googling ‘TinyMVC+file_exists’ gave me link to that topic, where is written that they had fixed it in SVN version.

更多推荐

TinyMVC始终显示“默认"控制器

本文发布于:2023-11-01 02:15:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1547953.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控制器   TinyMVC   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!