[production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" appnamespace = "Application" autoloadernamespaces.app = "App_" autoloadernamespaces.my = "MyApp_" resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" resources.frontController.params.displayExceptions = 1 [staging : production] [testing : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 resources.frontController.params.displayExceptions = 1
<?php
class IndexController extends Zend_Controller_Action {
public function init() {
/* Initialize action controller here */
}
public function indexAction() {
var_dump ( Application_Model_Test::getUserInfo () );
App_Test::echoAppTest ();
MyApp_Test::echoAMyAppTest ();
Zend_Test::echoZendTest ();
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();
exit ();
}
}
<?php
class Model_ModelTest{
static function echoModelModelTest(){
echo 'Model_ModelTest<br/>';
}
}
<?php
class Application_Model_Test {
static public function getUserInfo() {
return array (
'user_name' => '张三',
'user_gender' => '男'
);
}
}
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected function _initAutoload() {
$app = $this->getApplication ();
$namespaces = array (
'AppTest'
);
$app->setAutoloaderNamespaces ( $namespaces );
return $app;
}
}
<?php
class App_Test {
static public function echoAppTest() {
echo 'App_Test<br/>';
}
}
<?php
class AppTest_Test{
static public function echoAppTestTest(){
echo 'AppTestTest<br/>';
}
}
<?php
class AppTest2_Test{
static public function echoAppTest2Test(){
echo 'AppTest2Test<br/>';
}
}
<?php
class MyApp_Test {
static public function echoAMyAppTest() {
echo 'MyApp_Test<br/>';
}
}
<?php
class Zend_Test{
static public function echoZendTest(){
echo 'ZendTest<br/>';
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有