src/BoomCMS/Chunk/Provider.php
public function edit($type, $slotname, $page = null)
    {
        $className = $this->getClassName($type);

        if ($page === null) {
            $page = Router::getActivePage();
        }

        $model = $this->find($type, $slotname, $page->getCurrentVersion());
        $attrs = $model ? $model->toArray() : [];

        $chunk = new $className($page, $attrs, $slotname);

        return $chunk->editable($this->allowedToEdit($page));
    }
public function edit($type, $slotname, $page = null)
    {
        $className = $this->getClassName($type);

        if ($page === null) {
            $page = Router::getActivePage();
        }

        $model = $this->find($type, $slotname, $page->getCurrentVersion());
        $attrs = $model ? $model->toArray() : [];

        $chunk = new $className($page, $attrs, $slotname);

        return $chunk->editable($this->allowedToEdit($page));
    }
public function edit ( $ type , $ slotname , $ page = null ) { $ className = $ this -> getClassName ( $ type ) ; if ( $ page === null ) { $ page = Router :: getActivePage ( ) ; } $ model = $ this -> find ( $ type , $ slotname , $ page -> getCurrentVersion ( ) ) ; $ attrs = $ model ? $ model -> toArray ( ) : [ ] ; $ chunk = new $ className ( $ page , $ attrs , $ slotname ) ; return $ chunk -> editable ( $ this -> allowedToEdit ( $ page ) ) ; }
Returns a chunk object of the required type.

@param string $type     Chunk type, e.g. text, feature, etc.
@param string $slotname The name of the slot to retrieve a chunk from.
@param mixed  $page     The page the chunk belongs to. If not given then the page from the current request will be used.

@return BaseChunk
Returns a chunk object of the required type .