/** * Sets the object to have an attribute class = 'active' and a property active set to TRUE * Also, if this object is and li tag, all anchor tags as children will also be set to active. * @param Nomad_Container $object */ protected function _setActive(Nomad_Container $object) { /** Set this tag to active */ $object->appendAttribute('class', 'active'); $object->active = TRUE; /** Set li children a tags to active (if any) */ $children = $object->getChildren(); if ($object->getTag() == 'li' && is_array($children)) { foreach ($children as $child) { if ($child->getTag() == 'a') { $child->appendAttribute('class', 'active'); $child->active = TRUE; } } } }
/** * Adds a child container to this container * @param Nomad_Container $container */ public function addChildContainer(Nomad_Container $container) { //$container->setParent($this); $this->_children[$container->getName()] = $container; }