src/Loops/Page.php
protected function __getLoopsId($refkey = NULL) {
        $classname = get_class($this);

        if($refkey) {
            $reflection = new ReflectionClass($classname);
            if($reflection->hasProperty($refkey)) {
                $classname = $reflection->getProperty($refkey)->getDeclaringClass()->getName();
            }
        }

        if($page_parameter = $this->parameter) {
            $parts = $newparts = explode("\\", $classname);

            while($parameter = array_shift($page_parameter)) {
                $pos = array_search("_", $parts);

                if($pos == FALSE) {
                    break;
                }

                $parts[$pos] = "";
                $newparts[$pos] = $parameter;
            }

            $loopsid = implode("-", $newparts);
        }
        else {
            $loopsid = str_replace("\\", "-", $classname);
        }

        return $loopsid;
    }
protected function __getLoopsId($refkey = NULL) {
        $classname = get_class($this);

        if($refkey) {
            $reflection = new ReflectionClass($classname);
            if($reflection->hasProperty($refkey)) {
                $classname = $reflection->getProperty($refkey)->getDeclaringClass()->getName();
            }
        }

        if($page_parameter = $this->parameter) {
            $parts = $newparts = explode("\\", $classname);

            while($parameter = array_shift($page_parameter)) {
                $pos = array_search("_", $parts);

                if($pos == FALSE) {
                    break;
                }

                $parts[$pos] = "";
                $newparts[$pos] = $parameter;
            }

            $loopsid = implode("-", $newparts);
        }
        else {
            $loopsid = str_replace("\\", "-", $classname);
        }

        return $loopsid;
    }
protected function __getLoopsId ( $ refkey = NULL ) { $ classname = get_class ( $ this ) ; if ( $ refkey ) { $ reflection = new ReflectionClass ( $ classname ) ; if ( $ reflection -> hasProperty ( $ refkey ) ) { $ classname = $ reflection -> getProperty ( $ refkey ) -> getDeclaringClass ( ) -> getName ( ) ; } } if ( $ page_parameter = $ this -> parameter ) { $ parts = $ newparts = explode ( "\\" , $ classname ) ; while ( $ parameter = array_shift ( $ page_parameter ) ) { $ pos = array_search ( "_" , $ parts ) ; if ( $ pos == FALSE ) { break ; } $ parts [ $ pos ] = "" ; $ newparts [ $ pos ] = $ parameter ; } $ loopsid = implode ( "-" , $ newparts ) ; } else { $ loopsid = str_replace ( "\\" , "-" , $ classname ) ; } return $ loopsid ; }
Take page element inheritance into account when generating the loopsid.

Normally the Loops id of a page element is generated by replacing all "\" (backslash) with "-" (dash)
of the pages classname.
Namespace parts that are underscores, as well if the classname is an underscore will be replaced with
the parameters that were used to create the page.

If the argument refkey is set, a part of the Loops id of a child element is requested. (See documentation
of "Loops\Element")
The part of the Loops id is generated and based on which property the child elemement is stored. The
declaring classname is used, this may be the name of a parent class.


Example:
In this example, the Loops id of property $form will not change, regardless which of the three classes are instantiated.
<code>
namespace Pages;

use Loops\Page;
use Loops\Annotations\Element\Form;

class Testpage extends Page {
/**
* \@Form
{@*}
protected $form; //Loops id of this element will (always) be "Pages-Testpage-form"
}

class Subtestpage extends Testpage {
/**
* \@Form
{@*}
protected $other_form; //Loops id of this element will be "Pages-Subtestpage-other_form"
}

class _ extends Testpage {
/**
* \@Form
{@*}
protected $other_form; //Loops id of this element will be "Pages-*-other_form" where * is replaced by the first parameter of the argument $parameter in the constructor
}
</code>

@param
Take page element inheritance into account when generating the loopsid .