全局网站参数 $config


网站参数在模板中的写法

变量名 备注
{$config.title} 网站名称
{$config.dir} 网站安装目录,根目录即为/
{$config.domain} 网站域名,此值为人工设置,与{$config.dir}可以组成有效的域名安装,等同于{$sys.url}
{$config.logo} 网站LOGO图标,仅限前台使用
{$config.logo_mobile} 手机网站Logo图片,仅限前台使用
{$config.favicon} 收藏夹用的图标,一般是64x64规格的PNG图片
{$config.meta} 前端HTML里的head扩展,建议您有head验证时,都写到这里来
{$config.status} 值为1时表示网站开启中,为0表示网站关闭,关闭的原因请使用{$config.content}
{$config.content} 网站关闭说明
{$config.register_status} 值为1时表示网站开启用户注册,为0表示关闭
{$config.register_close} 关闭用户注册时的友好提示说明
{$config.login_status} 值为1时表示网站开启用户登录,为0表示关闭
{$config.login_close} 关闭用户登录时的友好提示说明
{$config.url_type} 链接方式,default 默认链接,rewrite 伪静态页模式
{$config.login_type_email} 用于邮件登录发送邮件验证码的模板
{$config.login_type_sms} 用于短信登录发送短信验证码的模板
{$config.biz_status} 1表示开启电商功能,0表示关闭电商
{$config.biz_is_user} 1表示购物需要用户登录,0表示游客可下单
{$config.biz_main_service} 1表示电商以服务为主,0表示电商以实物为主
{$config.currency_id} 电商结算货币的ID
{$config.currency} 电商结算的货币,数组模式
{$config.upload_guest} 设为1表示允许游客上传,为0表示游客不能上传(未开启,留言表单上传无效)
{$config.upload_user} 设为1表示允许用户上传,为0表示用户不能上传(未开启,用户无法上传)
{$config.标识串} 用户自定义扩展的全局变量信息,数组模式,请用 {ebug $config} 查看

 

网站参数在插件和应用中的写法

网站参数在插件 / 应用里可以使用$this->site来替换$config,示例:

$this->site['title'];
$this->site['login_status'];

 

网站参数在 phpinc 里的写法

网站参数在 phpinc 里可以使用$app->site来替换$config,示例:

$app->site['title'];
$app->site['login_status'];

 

评论反馈