를 자동 로딩 .../프로젝트 이름은/라이브러리/Me의/Myclass.php는 다음과 정의 :젠드 프레임 워크가 : 여기 정의에서 클래스 라이브러리를 가지고 클래스 라이브러리
<?php
class Me_Myclass{
}
?>
내가있어 다음 부트 스트랩 : 내 컨트롤러에서
<?php
/**
* Application bootstrap
*
* @uses Zend_Application_Bootstrap_Bootstrap
*/
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
/**
* Bootstrap autoloader for application resources
*
* @return Zend_Application_Module_Autoloader
*/
protected function _initAutoload()
{
$autoloader = new Zend_Application_Module_Autoloader(array(
'namespace' => 'Default',
'basePath' => dirname(__FILE__),
));
$autoloader->registerNamespace('Me_');
return $autoloader;
}
/**
* Bootstrap the view doctype
*
* @return void
*/
protected function _initDoctype()
{
$this->bootstrap('view');
$view = $this->getResource('view');
$view->doctype('XHTML1_STRICT');
}
/**
* Bootstrap registry and store configuration information
*
* @return void
*/
protected function _initRegistry()
{
$config = new Zend_Config_Ini(APPLICATION_PATH .
'/configs/application.ini', APPLICATION_ENV,
array('allowModifications'=>true));
Zend_Registry::set('configuration', $config);
}
}
을 나는이 같은 클래스의 인스턴스를하려고 :/somethi : 나는 HTTP로 직접 이동하면
<?php
class SomeController extends Zend_Controller_Action
{
public function indexAction()
{
$classMaker=new Me_Myclass();
}
}
?>
을 ng.com/projectname/some?id=1 다음 오류가 발생합니다.
치명적 오류 : /home/myuser/work/projectname/application/controllers/SomeController.php x 줄에 'Me_Myclass'클래스가 없습니다.
아이디어가 있으십니까?
잠재적으로 타당한 잡록은 :
오토로더 내가 응용 프로그램/라이브러리에서 다른 폴더에 정의한 클래스와 모델을 확장있을 때 작동하는 것 같다.
누군가 'Default'를 변경하려고했지만 시도했지만 문제를 해결하지 못했고이 네임 스페이스를 사용하는 모델의 기능을 중단 할 때 부정적인 영향을 미쳤습니다.
이class Me_Myclass
{
}
폴더 구조 가질 수 있도록 최대 수준을 라이브러리 폴더를 이동
: 당신의 부트 스트랩에 다음
/
/application
/library
/public
그리고를 다음을 추가
100 %. 그게 무엇을 나타내는가? 치명적 오류 : 'Method'라는 메시지가있는 'Zend_Loader_Exception'예외입니다. /home/myuser/work/myproject/library/Zend/Loader/Autoloader/Resource.php:128 스택 추적 : http : //에서 registerNamespace가 지원되지 않습니다. pastie.org/799074 – user250120
작성한 코드의 변경 사항을 표시하려면 답변을 업데이트하십시오. – smack0007