public function getTpl($chnId, $tplType) { $ret = TFileHelper::buildPath(['model_default', str_replace('_tpl', '_default', $tplType)]); $cachedChannels = LuLu::getAppParam('cachedChannels'); if (isset($cachedChannels[$chnId])) { $channelModel = $cachedChannels[$chnId]; $table = $channelModel['table']; $tplName = $channelModel[$tplType]; $tplPath = CommonUtility::getThemePath(['content', $table, $tplName]); if (TFileHelper::exist($tplPath)) { $ret = TFileHelper::buildPath([$table, $tplName]); } else { LuLu::info($tplPath . ' does not exist', __METHOD__); } } return $ret; }
public function getTpl($chnId, $tplName) { $ret = TFileHelper::buildPath(['model_default', $tplName], false); $cachedChannels = LuLu::getAppParam('cachedChannels'); if (isset($cachedChannels[$chnId])) { $backend = \Yii::getAlias('@backend'); $channelModel = $cachedChannels[$chnId]; $table = $channelModel['table']; $tplPath = TFileHelper::buildPath([$backend, 'views', 'content', $table, $tplName . '.php'], false); if (TFileHelper::exist($tplPath)) { $ret = TFileHelper::buildPath([$table, $tplName], false); } else { LuLu::info($tplPath . ' does not exist in backend', __METHOD__); } } return $ret; }
public static function getThemePath($path = null) { $currentTheme = self::getCurrentTheme(); $frontend = \Yii::getAlias('@frontend'); if (is_array($path)) { $dir = array_merge([$frontend, 'themes', $currentTheme], $path); } else { if (is_string($path)) { $dir = [$frontend, 'themes', $currentTheme, $path]; } else { $dir = [$frontend, 'themes', $currentTheme]; } } return TFileHelper::buildPath($dir); }