Skip to content

Commit

Permalink
调整autoload顺序
Browse files Browse the repository at this point in the history
  • Loading branch information
shenzhe committed Jun 21, 2013
1 parent 15deefb commit cae0ec1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ zphp是一个极轻的的,专用于游戏(社交,网页,移动)的服务

约定
===========
config/examle/base.php 里的配置项目是必需的。
config/example/base.php 里的配置项目是必需的。



2 changes: 1 addition & 1 deletion ZPHP/Core/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Route
{
public static function route($server)
{
$action = ZPHP::getAppPath() . '\\' . Config::get('ctrl_path', 'ctrl') . '\\' . $server->getAction();
$action = Config::get('ctrl_path', 'ctrl') . '\\' . $server->getAction();
$class = Factory::getInstance($action);
if (!($class instanceof IController)) {
throw new \Exception("ctrl error");
Expand Down
2 changes: 1 addition & 1 deletion ZPHP/ZPHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ final public static function autoLoader($class)
{
$baseClasspath = \str_replace('\\', DS, $class) . '.php';
$libs = array(
'',
self::$appPath . DS,
'',
'lib' . DS
);
foreach ($libs as $lib) {
Expand Down
5 changes: 3 additions & 2 deletions apps/ctrl/main.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace apps\ctrl;
namespace ctrl;
use ZPHP\Controller\IController,
ZPHP\Core\Config,
ZPHP\View;
Expand Down Expand Up @@ -32,7 +32,8 @@ public function main()
$model.= "key:{$key}=>{$val}\n";
}
}
$view = View\Factory::getInstance('String');
$viewMode = Config::get('view_mode', 'String');
$view = View\Factory::getInstance($viewMode);
$view->setModel($model);
return $view;
}
Expand Down

0 comments on commit cae0ec1

Please sign in to comment.