src/ministruts/Tile.php
public function render() {
        $request     = Request::me();
        $namespace   = $this->module->getViewNamespace();
        $appUri      = $request->getApplicationBaseUri();
        $nestedTiles = $this->nestedTiles;
        foreach ($nestedTiles as $tile) {
            $tile->setParent($this);
        }
        $properties  = $this->getMergedProperties();

        if (!defined($namespace.'APP')) {
            define($namespace.'APP', strLeft($appUri, -1));
        }
        if (!defined($namespace.'MODULE')) {
            $moduleUri = $appUri.$this->module->getPrefix();
            define($namespace.'MODULE', strLeft($moduleUri, -1));
        }

        $properties['request' ] = $request;
        $properties['response'] = Response::me();
        $properties['session' ] = $request->isSession() ? $request->getSession() : null;
        $properties['form'    ] = $request->getAttribute(ACTION_FORM_KEY);
        $properties['page'    ] = Page::me();

        if ($this->isPushModelSupport()) {
            $pageValues = Page::me()->values();
            $properties = \array_merge($properties, $pageValues);
        }

        $tileHint = false;
        if (Application::isAdminIP()) {
            $rootDir  = $this->di('config')['app.dir.root'];
            $file     = $this->fileName;
            $file     = strRightFrom($file, $rootDir.DIRECTORY_SEPARATOR, 1, false, $file);
            $file     = 'file="'.str_replace('\\', '/', $file).'"';
            $tile     = $this->name==self::GENERIC_NAME ? '':'tile="'.$this->name.'" ';
            $tileHint = $tile.$file;
            echo ($this->parent ? NL:'').'<!-- #begin: '.$tileHint.' -->'.NL;
        }

        includeFile($this->fileName, $nestedTiles + $properties);

        if ($tileHint) {
            echo NL.'<!-- #end: '.$tileHint.' -->'.NL;
        }
        return $this;
    }
public function render() {
        $request     = Request::me();
        $namespace   = $this->module->getViewNamespace();
        $appUri      = $request->getApplicationBaseUri();
        $nestedTiles = $this->nestedTiles;
        foreach ($nestedTiles as $tile) {
            $tile->setParent($this);
        }
        $properties  = $this->getMergedProperties();

        if (!defined($namespace.'APP')) {
            define($namespace.'APP', strLeft($appUri, -1));
        }
        if (!defined($namespace.'MODULE')) {
            $moduleUri = $appUri.$this->module->getPrefix();
            define($namespace.'MODULE', strLeft($moduleUri, -1));
        }

        $properties['request' ] = $request;
        $properties['response'] = Response::me();
        $properties['session' ] = $request->isSession() ? $request->getSession() : null;
        $properties['form'    ] = $request->getAttribute(ACTION_FORM_KEY);
        $properties['page'    ] = Page::me();

        if ($this->isPushModelSupport()) {
            $pageValues = Page::me()->values();
            $properties = \array_merge($properties, $pageValues);
        }

        $tileHint = false;
        if (Application::isAdminIP()) {
            $rootDir  = $this->di('config')['app.dir.root'];
            $file     = $this->fileName;
            $file     = strRightFrom($file, $rootDir.DIRECTORY_SEPARATOR, 1, false, $file);
            $file     = 'file="'.str_replace('\\', '/', $file).'"';
            $tile     = $this->name==self::GENERIC_NAME ? '':'tile="'.$this->name.'" ';
            $tileHint = $tile.$file;
            echo ($this->parent ? NL:'').'<!-- #begin: '.$tileHint.' -->'.NL;
        }

        includeFile($this->fileName, $nestedTiles + $properties);

        if ($tileHint) {
            echo NL.'<!-- #end: '.$tileHint.' -->'.NL;
        }
        return $this;
    }
public function render ( ) { $ request = Request :: me ( ) ; $ namespace = $ this -> module -> getViewNamespace ( ) ; $ appUri = $ request -> getApplicationBaseUri ( ) ; $ nestedTiles = $ this -> nestedTiles ; foreach ( $ nestedTiles as $ tile ) { $ tile -> setParent ( $ this ) ; } $ properties = $ this -> getMergedProperties ( ) ; if ( ! defined ( $ namespace . 'APP' ) ) { define ( $ namespace . 'APP' , strLeft ( $ appUri , - 1 ) ) ; } if ( ! defined ( $ namespace . 'MODULE' ) ) { $ moduleUri = $ appUri . $ this -> module -> getPrefix ( ) ; define ( $ namespace . 'MODULE' , strLeft ( $ moduleUri , - 1 ) ) ; } $ properties [ 'request' ] = $ request ; $ properties [ 'response' ] = Response :: me ( ) ; $ properties [ 'session' ] = $ request -> isSession ( ) ? $ request -> getSession ( ) : null ; $ properties [ 'form' ] = $ request -> getAttribute ( ACTION_FORM_KEY ) ; $ properties [ 'page' ] = Page :: me ( ) ; if ( $ this -> isPushModelSupport ( ) ) { $ pageValues = Page :: me ( ) -> values ( ) ; $ properties = \ array_merge ( $ properties , $ pageValues ) ; } $ tileHint = false ; if ( Application :: isAdminIP ( ) ) { $ rootDir = $ this -> di ( 'config' ) [ 'app.dir.root' ] ; $ file = $ this -> fileName ; $ file = strRightFrom ( $ file , $ rootDir . DIRECTORY_SEPARATOR , 1 , false , $ file ) ; $ file = 'file="' . str_replace ( '\\' , '/' , $ file ) . '"' ; $ tile = $ this -> name == self :: GENERIC_NAME ? '' : 'tile="' . $ this -> name . '" ' ; $ tileHint = $ tile . $ file ; echo ( $ this -> parent ? NL : '' ) . '<!-- #begin: ' . $ tileHint . ' -->' . NL ; } includeFile ( $ this -> fileName , $ nestedTiles + $ properties ) ; if ( $ tileHint ) { echo NL . '<!-- #end: ' . $ tileHint . ' -->' . NL ; } return $ this ; }
Render the Tile.

@return $this
Render the Tile .