매우 이상한 문제가 있습니다. 내 개발 환경 (우분투 게스트에서 공유 된 Windows 호스트)을 사용할 때 다음 코드가 정상적으로 작동합니다. 그러나 리눅스 서버에있을 때 또는 우분투 게스트에 파일을 복사하지만 기본 방향 (호스트에서 공유하지 않음)이더라도 코드는 실패합니다. 내가받는 오류 :ZF2 Form Collections Zend Form FormElementManager :: get이 인스턴스를 가져 오거나 만들 수 없습니다.
Zend\Form\FormElementManager::get was unable to fetch or create an instance for RA\Restriction\Form\ValueFieldset
그래서 파일을 찾을 수 없다는 것이 문제입니다.
다음/vendor/zendframework/zendframework/library/Zend/ServiceManager/AbstractPluginManager.php(103): Zend\ServiceManager\ServiceManager->get('RA...', true)
내가이 날 모든 작업을 봤는데 해결책을 마련하지 못하고
namespace RA\Restriction\Form;
use Zend\Form\Form;
use Zend\Form\Element;
use Zend\InputFilter\InputFilter;
class RestrictionValueForm extends Form
{
public function __construct($name = null)
{
// we want to ignore the name passed
parent::__construct('attribute');
$this->setAttribute('method', 'post')
->setInputFilter(new InputFilter());;
$this->add(array(
'name' => 'restriction_id',
'attributes' => array(
'type' => 'hidden',
'id' => 'restriction_id',
),
));
$this->add(array(
'type' => 'collection',
'name' => 'value_name',
'options' => array(
'count' => 2,
'should_create_template' => true,
'template_placeholder' => '__placeholder__',
'label' => '',
'target_element' => array(
'type' => 'RA\Restriction\Form\ValueFieldset',
),
),
));
$this->add(array(
'name' => 'submit',
'attributes' => array(
'type' => 'submit',
'class' => 'btn btn-primary mar-right5',
'value' => 'Save',
'id' => 'submitbutton',
),
));
$this->add(array(
'name' => 'cancel',
'attributes' => array(
'type' => 'button',
'class' => 'btn',
'value' => 'Cancel',
'id' => 'cancel',
),
));
}
}
처럼 내 양식 파일이 모습입니다에서 스택 추적 사망 I도 몇 가지 여분의 환경을 구축하고 configs가 동일했는지 확인하십시오. 모든 제안은 매우 감사하겠습니다.
파일은 어디에 있습니까? –
경로 /module/RA/src/RA/Restriction/Form/ValueFieldset.php –
마침내 문제를 해결할 수있었습니다. 일부 환경에서는 필드 세트가 하위 디렉토리에있는 것을 좋아하지 않습니다. fieldset을/RA/src/RA/Form/ValueFieldset으로 옮길 수 있었고 모든 것이 이제 행복합니다. –