I already created a "Main menu", in my create menu option in application, when save button clicked, i want to create a menu "Second Menu" under "Main Menu" as child. How it is possible?
Yes, you can create multiple tree structures in a single table, using the 'tree_id' column to uniquely identify the tree. You can use if field as a foreign key to a parent table that defines the trees (give them a name, etc), but you don't need to.
You can add nodes to an existing tree without problems.
"name" was just an example, you can put anything in it, as long as the table has a left and right pointer, and optionally a tree_id.
ORM models must always have a unique key. Just have it auto_increment, you don't need to use it. Using a title as key is not advised, it is not guaranteed to be unique, changing it means index updates, and string index creation and lookups are not very efficient.
What do you mean with "how do you identify a menu"? If the table only has one tree, that is the menu. If it has multiple trees, the tree_id column (you can name it any way you want, for example menu_id) is the identifier of the tree. See http://docs.fuelphp.com/packages/orm/model/nestedset.html#/method_get_root on how you select the root of the tree.
When retrieving a menu, you can use the dump_tree() method to fetch a complete tree in one go. You can then recurse over it, for example to create an unordered list HTML structure for your menu.
exactly i used Debug::dump() to check the array returned using dump_tree(). This Debug::dump() not providing detailed children details, it showing there is children and ..... are showing, But when i flatten the array, i found there are all listed in array.