您的位置:首页 > 其它

Joomla 摘要

2016-01-11 00:00 399 查看

在View的函数中检查错误

if(count($errors = $this->get('Error')))
{
JLog::add(implode('<br />', $errors), JLog::WARNING, 'jerror');
return false;
}


获取输入内容

$jinput = JFactory::getApplication()->input;

获取输入的整型变量id值

JFactory::getApplication()->input->get('id',1,'INT');


Component数据库脚本文件

admin/sql/install.mysql.utf8.sql     //安装时的脚本
admin/sql/uninstall.mysql.utf8.sql   //卸载时的数据库操作
admin/sql/updates/mysql/*.*.*.sql    //升级到*.*.*版本时的数据库操作

组件的xml文件,要添加下面内容

<install> <!-- Runs on install -->
<sql>
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
</sql>
</install>

<uninstall> <!-- Runs on uninstall -->
<sql>
<file driver="mysql" charset="utf8">sql/uninstall.mysql.utf8.sql</file>
</sql>
</uninstall>

<update> <!-- Runs on update; New since J2.5 -->
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>

<administration>
<files folder="admin">
<folder>sql</folder>
</files>
</administration>


JForm 字段属性 Showon

<field name="foo" type="list">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="bar" type="text" showon="foo:1"/>

字段bar在foo选择的值为1的时候,显现。如果要匹配多个值,使用:

showon="foo:1,2"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  joomla