Pimcore\Model\Document\Tag\Block::start PHP Method

start() public method

Is executed at the beginning of the loop and setup some general settings
public start ( )
    public function start()
    {
        $this->setupStaticEnvironment();
        // get configuration data for admin
        if (method_exists($this, "getDataEditmode")) {
            $data = $this->getDataEditmode();
        } else {
            $data = $this->getData();
        }
        $options = ["options" => $this->getOptions(), "data" => $data, "name" => $this->getName(), "id" => "pimcore_editable_" . $this->getName(), "type" => $this->getType(), "inherited" => $this->getInherited()];
        $options = @\Zend_Json::encode($options);
        //$options = base64_encode($options);
        $this->outputEditmode('
            <script type="text/javascript">
                editableConfigurations.push(' . $options . ');
            </script>
        ');
        // set name suffix for the whole block element, this will be addet to all child elements of the block
        $suffixes = \Zend_Registry::get("pimcore_tag_block_current");
        $suffixes[] = $this->getName();
        \Zend_Registry::set("pimcore_tag_block_current", $suffixes);
        $class = "pimcore_editable pimcore_tag_" . $this->getType();
        if (array_key_exists("class", $this->getOptions())) {
            $class .= " " . $this->getOptions()["class"];
        }
        $this->outputEditmode('<div id="pimcore_editable_' . $this->getName() . '" name="' . $this->getName() . '" class="' . $class . '" type="' . $this->getType() . '">');
        return $this;
    }