Hi
These functions in ganon.php:
function getChildrenByID($id, $recursive = true) {
return getChildrenByAttribute('id', $id, 'equals', 'total', $recursive);
}
function getChildrenByClass($class, $recursive = true) {
return getChildrenByAttribute('class', $id, 'equals', 'total', $recursive);
}
function getChildrenByName($name, $recursive = true) {
return getChildrenByAttribute('name', $name, 'equals', 'total', $recursive);
}
returns an error, because the call ( getChildrenByAttribute ) is not in the
scope
of the class.
You must make the call as:
function getChildrenByID($id, $recursive = true) {
return $this->getChildrenByAttribute('id', $id, 'equals', 'total', $recursive);
}
function getChildrenByClass($class, $recursive = true) {
return $this->getChildrenByAttribute('class', $id, 'equals', 'total', $recursive);
}
function getChildrenByName($name, $recursive = true) {
return $this->getChildrenByAttribute('name', $name, 'equals', 'total', $recursive);
}
in order to work...
or... you can put off that function_create invention and do a normal select
instead:
function getChildrenByAttribute($attribute, $value, $mode = 'equals', $compare = 'total', $recursive = true) {
return $this->select( sprintf('[%s="%s"]',$attribute,$value) );
}
function getChildrenByTag($tag, $compare = 'total', $recursive = true) {
return $this->select( $tag );
}
function getChildrenByID($id, $recursive = true) {
return $this->select( sprintf('[id="%s"]',$class) );
}
function getChildrenByClass($class, $recursive = true) {
return $this->select( sprintf('[class="%s"]',$class) );
}
function getChildrenByName($name, $recursive = true) {
return $this->select( sprintf('[name="%s"]',$class) );
}
Original issue reported on code.google.com by Radika...@gmail.com on 20 Sep 2012 at 11:37
Original issue reported on code.google.com by
Radika...@gmail.com
on 20 Sep 2012 at 11:37