phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 resources.frontController.params.displayExceptions = 1
zf create model Test
<?php
class Application_Model_Test
{}
Zend_Application_Bootstrap_Bootstrap Zend_Application_Module_Autoloader
<?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;
}
}
<?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/>';
}
}
<?php
class AppTest2_Test{
static public function echoAppTest2Test(){
echo 'AppTest2Test<br/>';
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有