src/Codegen/CodegenBase.php
protected function evaluatePHP($strFilename, $mixArgumentArray, &$templateSettings = null)
    {
        // Get all the arguments and set them locally
        if ($mixArgumentArray) {
            foreach ($mixArgumentArray as $strName => $mixValue) {
                $$strName = $mixValue;
            }
        }
        global $_TEMPLATE_SETTINGS;
        unset($_TEMPLATE_SETTINGS);
        $_TEMPLATE_SETTINGS = null;

        // Of course, we also need to locally allow "objCodeGen"
        $objCodeGen = $this;

        // Get Database Escape Identifiers
        $strEscapeIdentifierBegin = \QCubed\Database\Service::getDatabase($this->intDatabaseIndex)->EscapeIdentifierBegin;
        $strEscapeIdentifierEnd = \QCubed\Database\Service::getDatabase($this->intDatabaseIndex)->EscapeIdentifierEnd;

        // Store the Output Buffer locally
        $strAlreadyRendered = ob_get_contents();

        if (ob_get_level()) {
            ob_clean();
        }
        ob_start();
        include($strFilename);
        $strTemplate = ob_get_contents();
        ob_end_clean();

        $templateSettings = $_TEMPLATE_SETTINGS;
        unset($_TEMPLATE_SETTINGS);

        // Restore the output buffer and return evaluated template
        print($strAlreadyRendered);

        // Remove all \r from the template (for Win/*nix compatibility)
        $strTemplate = str_replace("\r", '', $strTemplate);
        return $strTemplate;
    }
protected function evaluatePHP($strFilename, $mixArgumentArray, &$templateSettings = null)
    {
        // Get all the arguments and set them locally
        if ($mixArgumentArray) {
            foreach ($mixArgumentArray as $strName => $mixValue) {
                $$strName = $mixValue;
            }
        }
        global $_TEMPLATE_SETTINGS;
        unset($_TEMPLATE_SETTINGS);
        $_TEMPLATE_SETTINGS = null;

        // Of course, we also need to locally allow "objCodeGen"
        $objCodeGen = $this;

        // Get Database Escape Identifiers
        $strEscapeIdentifierBegin = \QCubed\Database\Service::getDatabase($this->intDatabaseIndex)->EscapeIdentifierBegin;
        $strEscapeIdentifierEnd = \QCubed\Database\Service::getDatabase($this->intDatabaseIndex)->EscapeIdentifierEnd;

        // Store the Output Buffer locally
        $strAlreadyRendered = ob_get_contents();

        if (ob_get_level()) {
            ob_clean();
        }
        ob_start();
        include($strFilename);
        $strTemplate = ob_get_contents();
        ob_end_clean();

        $templateSettings = $_TEMPLATE_SETTINGS;
        unset($_TEMPLATE_SETTINGS);

        // Restore the output buffer and return evaluated template
        print($strAlreadyRendered);

        // Remove all \r from the template (for Win/*nix compatibility)
        $strTemplate = str_replace("\r", '', $strTemplate);
        return $strTemplate;
    }
protected function evaluatePHP ( $ strFilename , $ mixArgumentArray , & $ templateSettings = null ) { // Get all the arguments and set them locally if ( $ mixArgumentArray ) { foreach ( $ mixArgumentArray as $ strName => $ mixValue ) { $ $ strName = $ mixValue ; } } global $ _TEMPLATE_SETTINGS ; unset ( $ _TEMPLATE_SETTINGS ) ; $ _TEMPLATE_SETTINGS = null ; // Of course, we also need to locally allow "objCodeGen" $ objCodeGen = $ this ; // Get Database Escape Identifiers $ strEscapeIdentifierBegin = \ QCubed \ Database \ Service :: getDatabase ( $ this -> intDatabaseIndex ) -> EscapeIdentifierBegin ; $ strEscapeIdentifierEnd = \ QCubed \ Database \ Service :: getDatabase ( $ this -> intDatabaseIndex ) -> EscapeIdentifierEnd ; // Store the Output Buffer locally $ strAlreadyRendered = ob_get_contents ( ) ; if ( ob_get_level ( ) ) { ob_clean ( ) ; } ob_start ( ) ; include ( $ strFilename ) ; $ strTemplate = ob_get_contents ( ) ; ob_end_clean ( ) ; $ templateSettings = $ _TEMPLATE_SETTINGS ; unset ( $ _TEMPLATE_SETTINGS ) ; // Restore the output buffer and return evaluated template print ( $ strAlreadyRendered ) ; // Remove all \r from the template (for Win/*nix compatibility) $ strTemplate = str_replace ( "\r" , '' , $ strTemplate ) ; return $ strTemplate ; }
Returns the evaluated PHP

@param $strFilename
@param $mixArgumentArray
@param null $templateSettings
@return mixed|string
Returns the evaluated PHP