0
내 사용자 정의 젠드 폼 필터 클래스가로드되지 않습니다. SF_Filter_AlnumDashes 그것은에 상주 :젠드 폼 사용자 정의 필터 클래스를 찾을 수 없음
사용자 정의 필터 클래스 이름입니다 라이브러리/SF/필터/AlnumDashes.php.
내가 application.ini에 "SF_"네임 스페이스에 대한 자동 로딩을 구성한 :
autoloadernamespaces[] = "SF_"
을하지만 젠드 양식 작성시 클래스를로드하려고 할 때이 클래스 coudn't을 찾을 수 있다는 오류가 발생합니다 : 치명적인 오류 :
class Admin_Form_Product_Generalinfo extends SF_Form_Abstract {
public function init() {
//set ID Attribute on the form element
$this->setAttrib('id', 'product_general_info');
$elementPrefixPaths = array(
array(
array(
'prefix' => 'SF_Filter',
'path' => 'SF/Filter/', // 'application/validators' in your case
'type' => 'filter',
)
)
);
$this->addElementPrefixPaths($elementPrefixPaths);
$this->addElement('text', 'title', array(
'filters' => array('StringTrim', 'StripTags'),
'validators' => array(
array('StringLength', true, array(2, 250)),
),
'required' => true,
'label' => 'Title',
'attribs' => array(
'id' => 'title',
'class' => 'inputbox'
)
));
$this->getElement('title')->addFilter(array(new AlnumDashesUnderscore(), array(1)));
: 클래스 'AlnumDashesUnderscore'에서 발견되지는 ... 여기
젠드 양식 클래스에서 오류의 원인이되는 코드
"SF_"네임 스페이스에 다른 클래스가있어 문제없이 성공적으로로드 할 수 있습니다.
을 잘 내가 그렇게한다면 나는이 예외를 얻을 : 예외 정보 : 메시지 :이 클래스 이름이 일치 할 필요가 AddFilter를 제공 잘못된 필터; string 또는 Zend_Filter_Interface 여야합니다. – vlatkorun
그래, 그건 별개의 문제입니다. 필터는'Zend_Filter_Interface'를 구현해야하므로 사용자 정의 필터를 적절히 수정해야합니다. –
필터 클래스는 Zend_Filter_Interface : 클래스를 구현합니다. SF_Filter_AlnumDashes는 Zend_Filter_Interface를 구현합니다. – vlatkorun