在写mvc框架的时候遇到一个control方面的问题
在学习框架的过程中,发觉都是在单文件index.php入口那进行设置,分配
在index.php那我写上了
include MYROOT./applictions/controllers/func/arg1/arg2/...
那么可以实现在controllers文件里面的showname.php写一个showname的类,那么就是可以实现
localhost/mylession/index.php/showname/elson这样去访问
问题来了,我如果想在controllers里面在加一个文件夹 文件夹1 在文件夹1里面写上shouname
这样localhost/mylession/index.php/文件夹1/showname/elson去访问是不行的,
因为index.php规定写死了include MYROOT./applictions/controllers/func/arg1/arg2/...,如果要写就只能在配置里面手动配上include MYROOT./applictions/controllers/文件夹1/func/arg1/arg2/..,万一在文件夹1里面又套一个文件夹2,文件夹2里面又套一个3.....那岂不是
include MYROOT./applictions/controllers/文件夹1/文件夹2/文件夹3...../func/arg1/arg2/...这样明显不行
请问如何在index.php里面写才可以通过这样localhost/mylession/index.php/文件夹1/文件夹2/..../showname/elson,而定位到controllers里面的showname.php呢?