💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 4. 模板变量 ## 模板变量 - `$Cate` 模板变量(数组) 栏目信息,存在于栏目分类页、列表页、单页、内容页。调用方式如下。 ``` <pre class="calibre16">``` <span class="token5">// 获取栏目标题</span> <span class="token"><</span>h1 class<span class="token">=</span><span class="token4">"mb-3 mt-5 bread"</span><span class="token">></span><span class="token1">{</span>$Cate<span class="token1">.</span>title<span class="token1">}</span><span class="token"><</span><span class="token">/</span>h1<span class="token">></span> <span class="token"><</span>p<span class="token">></span><span class="token"><</span><span class="token">?</span>php <span class="token6">dump</span><span class="token1">(</span>$Cate<span class="token1">)</span><span class="token1">;</span><span class="token5">//查看所有字段 ?></p></span> ``` ``` - `$Info` 模板变量(数组) 内容详情信息,存在单页、内容页。更多字段可前往后台找到对应模型字段查看。 ``` <pre class="calibre16">``` <span class="token"><</span>h2 class<span class="token">=</span><span class="token4">"mb-3"</span><span class="token">></span><span class="token1">{</span>$Info<span class="token1">.</span>title<span class="token1">}</span><span class="token"><</span><span class="token">/</span>h2<span class="token">></span> <span class="token"><</span>p<span class="token">></span><span class="token"><</span><span class="token">?</span>php <span class="token6">dump</span><span class="token1">(</span>$Info<span class="token1">)</span><span class="token1">;</span><span class="token5">//查看所有字段 ?></p></span> ``` ``` - `$Tpl` 模板配置 根据模板配置config.json里面获取。只有模板有config.json文件的,前台才能调取。