We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Can not create node with incubator

I have create model :

Category: <?php namespace Idoc\Models;

use Phalcon\Mvc\Model\Behavior\NestedSet as NestedSetBehavior;

class Category extends \Phalcon\Mvc\Model { public $id; public $lft; public $rgt; public $level; public $title;

public function initialize()
{
    $this->addBehavior(new NestedSetBehavior(array(
        'rootAttribute'  => 'root',
        'leftAttribute'  => 'lft',
        'rightAttribute' => 'rgt',
        'levelAttribute' => 'level',
    )));
}

}

Controller :

<?php

namespace Idoc\Modules\Backend\Controllers;

use Phalcon\Tag; use Idoc\Models\Category; use Idoc\Modules\Backend\Forms\CategoryForm;

class CategoryController extends ControllerBase {

public function initialize()
{
    $this->view->setTemplateBefore('admincp');
}

public function indexAction()
{

}

/**
 * Creates a User
 */
public function addAction()
{
    $root = new Category();
    $root->title = 'Cars';
    $root->saveNode();
}

}

But why it's not save node record in data, nothing happen . I use postgresql data. Please help



43.9k

Hi,

first try to get some logs (from webserver, from database server) ... and put them here



6.6k

I have tried but nothing error



6.6k

need help please