restructure application classes

This commit is contained in:
coderkun 2014-05-14 18:30:25 +02:00
commit ff849bd72c
29 changed files with 53 additions and 36 deletions

View file

@ -9,7 +9,7 @@
* @link https://bitbucket.org/coderkun/the-legend-of-z
*/
namespace hhu\z;
namespace hhu\z\agents;
/**
@ -107,6 +107,23 @@
}
/**
* Determine the classname for the given Agent name.
*
* @static
* @param string $agentName Agent name to get classname of
* @param string $agentType Agent type of given Agent name
* @return string Classname for the Agent name
*/
/*private static function getClassName($agentName, $agentType)
{
$className = ClassLoader::concatClassNames($agentName, 'agent');
return \nre\configs\AppConfig::$app['namespace']."agents\\$agentType\\$className";
}*/
/**
* Load the class of a QuesttypeAgent.
*
@ -256,10 +273,10 @@
// Load Controller
\hhu\z\QuesttypeController::load($controllerName);
\hhu\z\controllers\QuesttypeController::load($controllerName);
// Construct Controller
$this->controller = QuesttypeController::factory($controllerName, $toplevelAgentName, $action, $this);
$this->controller = \hhu\z\controllers\QuesttypeController::factory($controllerName, $toplevelAgentName, $action, $this);
}
}

View file

@ -9,7 +9,7 @@
* @link https://bitbucket.org/coderkun/the-legend-of-z
*/
namespace hhu\z;
namespace hhu\z\agents;
/**

View file

@ -9,7 +9,7 @@
* @link https://bitbucket.org/coderkun/the-legend-of-z
*/
namespace hhu\z;
namespace hhu\z\controllers;
/**
@ -273,11 +273,11 @@
$model = \nre\core\ClassLoader::stripClassType(\nre\core\ClassLoader::stripClassType(\nre\core\ClassLoader::stripNamespace(get_class($this))));
// Load class
QuesttypeModel::load($model);
\hhu\z\models\QuesttypeModel::load($model);
// Construct Model
$modelName = ucfirst(strtolower($model));
$this->$modelName = QuesttypeModel::factory($model);
$this->$modelName = \hhu\z\models\QuesttypeModel::factory($model);
}
@ -300,7 +300,7 @@
// Load view
$this->view = QuesttypeView::loadAndFactory($layoutName, $controllerName, $action);
$this->view = \hhu\z\views\QuesttypeView::loadAndFactory($layoutName, $controllerName, $action);
}
}

View file

@ -9,7 +9,7 @@
* @link https://bitbucket.org/coderkun/the-legend-of-z
*/
namespace hhu\z;
namespace hhu\z\models;
/**

View file

@ -9,7 +9,7 @@
* @link https://bitbucket.org/coderkun/the-legend-of-z
*/
namespace hhu\z;
namespace hhu\z\views;
/**