Chciałbym dołączyć własny formularz do admin generatora.
Otóż przerabiam ten tutorial.
Wszystkie pliki mam już zrobione.
Ale nie wiem czy dobrze dołączyłem własny formularz, bo wywala mi poniższy bład
Fatal error: Class 'BaseTreeForm' not found in C:\xampp\htdocs\cms\lib\form\doctrine\TreeForm.class.php on line 3
A dołączam formularz w taki sposób:
form: class: TreeForm
Dla pewności jeszcze dołączę kod formularza
<?php class TreeForm extends BaseTreeForm { protected $parentId = null; public function configure() { 'model' => 'tree', 'add_empty' => '~ (object is at root level)', 'method' => 'getIndentedName' )); 'required' => false, 'model' => 'tree' )); $this->setDefault('parent_id', $this->object->getParentId()); $this->widgetSchema->setLabel('parent_id', 'Child of'); } public function updateParentIdColumn($parentId) { $this->parentId = $parentId; // further action is handled in the save() method } protected function doSave($con = null) { parent::doSave($con); $node = $this->object->getNode(); if ($this->parentId != $this->object->getParentId() || !$node->isValidNode()) { { //save as a root if ($node->isValidNode()) { $node->makeRoot($this->object['id']); $this->object->save($con); } else { $this->object->getTable()->getTree()->createRoot($this->object); //calls $this->object->save internally } } else { //form validation ensures an existing ID for $this->parentId $parent = $this->object->getTable()->find($this->parentId); $method = ($node->isValidNode() ? 'move' : 'insert') . 'AsFirstChildOf'; $node->$method($parent); //calls $this->object->save internally } } } }
Dziękuje z góry za odpowiedź