private function getDetailTpl($tpl) { $tplPath = CommonUtility::getThemePath(['page', $tpl]); if (TFileHelper::exist($tplPath)) { return $tpl; } return 'detail_default'; }
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; }