API16:JTree
From Joomla! Documentation
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Contents |
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.
$barbara = new JNode(); $stefanie = new JNode(); $sue = new JNode(); $peter = new JNode(); $stewie = new JNode(); $familyTree = new JTree(); //pointer set to root-node $familyTree->addChild($barbara, true) //pointer set to barbara $familyTree->addChild($sue) //$sue added as child to barbara, pointer still on barbara $familyTree->addChild($stefanie, true) //$stefanie added as child to barbara, pointer on stefanie $familyTree->addChild($peter, true) //$peter added as child to stefanie, pointer on peter $familyTree->getParent() // pointer set to parent of peter, which is stefanie $familyTree->addChild($stewie) //$stewie added as child to stefanie, pointer on stefanie
[Edit Descripton] JTree is a class that allows you to create and walk through object-trees. Used in conjunction with the JNode class.
Defined in
libraries/joomla/base/tree.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
Importing
jimport( 'joomla.base.tree' );
Examples
{{Expansion depth limit exceeded}}
Tree Structures with JTree and JNote
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree. Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>Edit DescriptonInvalid tag extension name: <span class="error">expansion depth limit exceeded</span> {{Expansion depth limit exceeded}}
<span class="error">Expansion depth limit exceeded libraries/joomla/base/tree.php <span class="error">Expansion depth limit exceeded
| Method name | Description |
|---|---|
| __construct | Class constructor, overridden in descendant classes. |
| addChild | |
| getParent | |
| reset |
<span class="error">Expansion depth limit exceeded Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>Edit See AlsoInvalid tag extension name: <span class="error">expansion depth limit exceeded</span> {{Expansion depth limit exceeded}}
<span class="error">Expansion depth limit exceeded Invalid tag extension name: <span class="error">expansion depth limit exceeded</span> Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
JTree and JNode can be used to create and process simple tree structures. Let's see how this works for JTree with a simple example.
We want to create the Family Tree of the Smiths. Granny Barbara has two daughters. Stefanie and Aunti Sue. Stefanie has two children, Peter and Stewie. Auntie Sue doesn't have children.
Let's take a look how we can represent this familiy in an object tree.