Esempio n. 1
0
 /**
  * Get tpl files from path
  */
 function getFile($tpl_name, $useDefault = true)
 {
     $file = null;
     $paths = p\value($this->_configs, ['paths']);
     if (!empty($paths[$tpl_name])) {
         $file = $paths[$tpl_name];
     } elseif ($useDefault) {
         $file = p\value($paths, ['index']);
     }
     if (!empty($file)) {
         return p\realpath($file);
     } else {
         return null;
     }
 }
Esempio n. 2
0
 function index($m, $f)
 {
     $this->_dot = \PMVC\plug('dotenv');
     $this->_underscore = \PMVC\plug('underscore');
     $configs = $this->_dot->getUnderscoreToArray('.env.dimension');
     $this->_folder = \PMVC\lastSlash(\PMVC\getOption('DIMENSION_FOLDER'));
     if (!\PMVC\realpath($this->_folder)) {
         return !trigger_error('Dimensions settings folder not exists. [' . $this->_folder . ']');
     }
     $this->_escape = \PMVC\value($configs, ['ESCAPE']);
     $allConfigs = $this->getConfigs('.dimension.base');
     foreach ($configs['DIMENSIONS'] as $dimension) {
         $dimensionConfigs = $this->processInputForOneDimension($f, $dimension);
         $allConfigs = array_replace_recursive($allConfigs, $dimensionConfigs);
     }
     \PMVC\dev($this->_inputs, DEBUG_KEY);
     if (isset($allConfigs['_'])) {
         $this->processConstantArray($allConfigs);
     }
     $go = $m['dump'];
     $go->set($allConfigs);
     return $go;
 }