$name = 'Model_Two';
str_replace('_','/',$name);
I need replace in __autoload function Model_Two to Two/Model_Two.class.php but i dont want using in autoload implode and explode how it work ? My functions have name Model_Two, Controller_Two and this is good. But my directory tree in framework , mvc is app/controllers/User/Controller_User.class.php.
I cant fi开发者_开发技巧nd method to repair my __autoload function. Maybe directory tree is wrong ?
Is this what you want?
require 'app/' . lcfirst(str_replace('_', 's/', $name)) . '/' . $name . '.php';
Use an existing naming convention and autoloader: PSR-0.
精彩评论