phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
zf create model Test
Creating a model at /www/model_demo1/application/models/Test.php
Updating project profile '/www/model_demo1/.zfproject.xml'
<?php
class Application_Model_Test
{}
<?php
class Zend_Test{
static public function echoZendTest(){
echo 'ZendTest<br/>';
}
}
appnamespace = "Application"
autoloadernamespaces.app = "App_"
autoloadernamespaces.my = "MyApp_"
autoloadernamespaces[] = "App_"
autoloadernamespaces[] = "MyApp_"
public function setOptions(array $options)
{
if (!empty($options['config'])) {
if (is_array($options['config'])) {
$_options = array();
foreach ($options['config'] as $tmp) {
$_options = $this->mergeOptions($_options, $this->_loadConfig($tmp));
}
$options = $this->mergeOptions($_options, $options);
} else {
$options = $this->mergeOptions($this->_loadConfig($options['config']), $options);
}
}
$this->_options = $options;
$options = array_change_key_case($options, CASE_LOWER);
$this->_optionKeys = array_keys($options);
if (!empty($options['phpsettings'])) {
$this->setPhpSettings($options['phpsettings']);
}
if (!empty($options['includepaths'])) {
$this->setIncludePaths($options['includepaths']);
}
if (!empty($options['autoloadernamespaces'])) {
$this->setAutoloaderNamespaces($options['autoloadernamespaces']);
}
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected function _initAutoload() {
$app = $this->getApplication ();
$namespaces = array (
'AppTest'
);
$app->setAutoloaderNamespaces ( $namespaces );
return $app;
}
}
/model_demo1/library/AppTest/Test.php
<?php
class AppTest_Test{
static public function echoAppTestTest(){
echo 'AppTestTest<br/>';
}
}
AppTest_Test::echoAppTestTest();
$auto_loader = Zend_Loader_Autoloader::getInstance();
$resourceLoader = new Zend_Loader_Autoloader_Resource(array(
'basePath' => '/www/model_demo1/application',
'namespace' => '',
'resourceTypes' => array(
'model' => array(
'path' => 'models',
'namespace' => 'Model'
)
)
)
);
$auto_loader->pushAutoloader($resourceLoader);
$auto_loader->registerNamespace(array('AppTest2_'));
AppTest2_Test::echoAppTest2Test();
Model_ModelTest::echoModelModelTest();
<?php
class Model_ModelTest{
static function echoModelModelTest(){
echo 'Model_ModelTest<br/>';
}
}
/model_demo1/library/AppTest2/Test.php
<?php
class AppTest2_Test{
static public function echoAppTest2Test(){
echo 'AppTest2Test<br/>';
}
}