Adding jQuery To Your Force.com Application

Adding jQuery To Your Force.com Application
By JOSH BIRK | Published: JANUARY 10, 2011
jQuery has been a game changer for many JavaScript developers, myself included. I once actively avoided most pre-built libraries for fear that somewhere after adopting them I would run into some conflict or limitation that would either slow or completely unravel any efficiency I got from using it in the first place. jQuery, however, rests comfortably in a new breed of libraries with massive amounts of community support – especially in terms of testing, additions and examples.

At Dreamforce, I had the distinct pleasure of presenting with Jason Venable, AKA TehNrd on twitter and the blogosphere, on adding jQuery to Salesforce. If you’re the type that likes to jump to the end … you can download the package of the demo org which includes the code samples or even view the video of the session.

The quick steps to getting started are simple:

1. Download jQuery
More specifically if you head over to the jQuery UI site, they have a great custom download builder, if you want to only get what you need.

2. Add jQuery as a Static Resource
ZIP in hand, you can include jQuery as a static resource, which will allow you to include the scripts easily within Visualforce pages.

3. Include jQuery scripts and set jQuery noConflict
Now that jQuery is accessible, simply add the reference to the jQuery libraries you need and then make sure to set jQuery noConflict. Here’s an example:

Using jQuery.noConflict() gets around the problem that other, natively included, libraries also use the $ variable to refer to global functions. In this example, you would refer to j$ instead and j$ will refer specifically to the jQuery functionality.

And that’s it – three easy steps and your Visualforce is ready for jQuery goodness. Check out the jQuery site for examples if you need some starting points, or Jason’s demo package for specifics with using it with Salesforce.

如何定制(中文化)Yii核心消息?

转载:http://www.isyii.com/330

如何定制(中文化)Yii核心消息?
发表于 2011 年 11 月 06 日 由 ning

参考地址:How to customize Yii core messages?

修改config/main.php

return array(
……
‘language’=>’de’,
‘components’=>array(
‘coreMessages’=>array(
‘basePath’=>null,
),
……
),
);

定义语言文件:

WebRoot/
protected/
messages/
zh_cn/
yii.php
zii.php
controllers/
views/
……

下载修改后的语言文件(结束句号已经批量修改为全角):
yii.php
1 /**
2 * Message translations.
3 *
4 * This file is automatically generated by ‘yiic message’ command.
5 * It contains the localizable messages extracted from source code.
6 * You may modify this file by translating the extracted messages.
7 *
8 * Each array element represents the translation (value) of a message (key).
9 * If the value is empty, the message is considered as not translated.
10 * Messages that no longer need translation will have their translations
11 * enclosed between a pair of ‘@@’ marks.
12 *
13 * NOTE, this file must be saved in UTF-8 encoding.
14 *
15 * @version $Id: yii.php 2879 2011-01-16 23:13:00Z qiang.xue $
16 */
17 return array (
18 ‘Active record class “{class}” does not have a scope named “{scope}”.’ => ‘AR类 “{class}” 没有名为 “{scope}” 的命名范围。’,
19 ‘Alias “{alias}” is invalid. Make sure it points to an existing PHP file.’ => ‘别名 “{alias}” 无效。请确认它指向一个存在的PHP文件。’,
20 ‘Alias “{alias}” is invalid. Make sure it points to an existing directory.’ => ‘别名 “{alias}” 无效。请确认它指向一个存在的目录。’,
21 ‘Application Log’ => ‘程序日志’,
22 ‘Base path “{path}” is not a valid directory.’ => ‘基准路径 “{path}” 不是一个有效的目录。’,
23 ‘CDbCacheDependency.connectionID “{id}” is invalid. Please make sure it refers to the ID of a CDbConnection application component.’ => ‘CDbCacheDependency.connectionID “{id}” 无效。请确认它指向一个有效的CDbConnection应用组件的ID’,
24 ‘CDbConnection failed to open the DB connection.’ => ‘CDbConnection连接数据库失败’,
25 ‘CDbTestFixture.connectionID “{id}” is invalid. Please make sure it refers to the ID of a CDbConnection application component.’ => ‘CDbTestFixture.connectionID “{id}” 无效。请确认它指向一个有效的CDbConnection应用组件的ID’,
26 ‘CEAcceleratorCache requires PHP eAccelerator extension to be loaded, enabled or compiled with the “–with-eaccelerator-shared-memory” option.’ => ‘CEAcceleratorCache需要PHP的Accelerator扩展被调用,并且使用 “–with-eaccelerator-shared-memory” 选项启用或者编译。’,
27 ‘CTypedMap<{type}> can only hold objects of {type} class.’ => ‘CTypedMap<{type}>仅支持{type}类的对象。’,
28 ‘CWinCache requires PHP wincache extension to be loaded.’ => ‘CWinCache需要PHP的wincache扩展被调用。’,
29 ‘CWinCache user cache is disabled. Please set wincache.ucenabled to On in your php.ini.’ => ‘CWinCache用户缓存北京永。请在php.ini中设置wincache.ucenabled启用。’,
30 ‘CZendDataCache requires PHP Zend Data Cache extension to be loaded.’ => ‘CZendDataCache需要PHP的Zend Data Cache扩展被调用。’,
31 ‘Column name must be either a string or an array.’ => ‘列名必须是一个字符串或者数组’,
32 ‘Extension path “{path}” does not exist.’ => ‘扩展路径 “{path}” 不存在。’,
33 ‘Failed to initialize the mcrypt module.’ => ‘初始化mcrypt模块失败。’,
34 ‘Failed to set unsafe attribute “{attribute}”.’ => ‘设置非安全(unsafe)属性 “{attribute}” 失败。’,
35 ‘GD and FreeType PHP extensions are required.’ => ‘PHP的GD和FreeType扩展需要被调用。’,
36 ‘Invalid operator “{operator}”.’ => ‘无效操作符 “{operator}”。’,
37 ‘Resetting PK sequence is not supported.’ => ‘重置主键(PK)序列不支持。’,
38 ‘Setting integrity check is not supported.’ => ‘设置完整性检查不支持。’,
39 ‘Table “{table}” does not exist.’ => ‘数据表 “{table}” 不存在。’,
40 ‘The “range” property must be specified with a list of values.’ => ‘”range” 属性必须用一个列表值设定。’,
41 ‘The STAT relation “{name}” cannot have child relations.’ => ‘STAT关联 “{name}” 不能有子关联。’,
42 ‘The module path “{path}” is not a valid directory.’ => ‘模块路径 “{path}” 不是一个有效的路径。’,
43 ‘The pattern for day of the week must be “E”, “EE”, “EEE”, “EEEE”, “EEEEE”, “e”, “ee”, “eee”, “eeee”, “eeeee”, “c”, “cccc” or “ccccc”.’ => ‘星期几的格式必须是 “E”, “EE”, “EEE”, “EEEE”, “EEEEE”, “e”, “ee”, “eee”, “eeee”, “eeeee”, “c”, “cccc” 或者 “ccccc”。’,
44 ‘The pattern for month must be “M”, “MM”, “MMM”, “MMMM”, “L”, “LL”, “LLL” or “LLLL”.’ => ‘月份的格式必须是 “M”, “MM”, “MMM”, “MMMM”, “L”, “LL”, “LLL” 或者 “LLLL”。’,
45 ‘The relation “{relation}” in active record class “{class}” is not specified correctly. The join table “{joinTable}” given in the foreign key cannot be found in the database.’=>’AR类 “{class}” 的关联 “{relation}” 的设定不正确。通过外键连接的数据表 “{joinTable}” 在数据库中找不到。’,
46 ‘The relation “{relation}” in active record class “{class}” is specified with a foreign key “{key}” that does not point to the parent table “{table}”.’ => ‘AR类 “{class}” 的关联 “{relation}” 设定的外键 “{key}” 没有指向父表 “{table}”。’,
47 ‘The relation “{relation}” in active record class “{class}” is specified with an invalid foreign key “{key}”. There is no such column in the table “{table}”.’ => ‘AR类 “{class}” 的关联 “{relation}” 设定了一个无效的外键 “{key}”。在数据表 “{table}” 中没有这样的列。’,
48 ‘The relation “{relation}” in active record class “{class}” is specified with an invalid foreign key. The columns in the key must match the primary keys of the table “{table}”.’ => ‘AR类 “{class}” 的关联 “{relation}” 设定了一个无效的外键 “{key}”。该键的列必须是数据表 “{table}” 的主键。’,
49 ‘The requested view “{name}” was not found.’ => ‘找不到请求的视图 “{name}”。’,
50 ‘The value for the column “{column}” is not supplied when querying the table “{table}”.’ => ‘查询数据表 “{table}” 时,不会提供列 “{column}” 的值。’,
51 ‘Unable to import “{alias}”. Please check your server configuration to make sure you are allowed to change PHP include_path.’ => ‘无法导入 “{alias}”。请检查您的服务器配置,以确保允许您的程序更改PHP的include_path设置。’,
52 ‘Unable to resolve the request “{route}”.’ => ‘无法解析请求 “{route}”。’,
53 ‘Unknown type “{type}”.’ => ‘未知类型 “{type}”。’,
54 ‘Your request is invalid.’ => ‘您的请求无效。’,
55 ‘{attribute} “{value}” is invalid.’ => ‘{attribute} “{value}” 无效。’,
56 ‘{attribute} cannot accept more than {limit} files.’ => ‘{attribute} 仅接受 {limit} 个以内的文件。’,
57 ‘{attribute} is in the list.’ => ‘{attribute} 在列表中’,
58 ‘{attribute} must be either {true} or {false}.’ => ‘{attribute} 必须为{true}或者{false}’,
59 ‘{attribute} must be greater than “{compareValue}”.’ => ‘{attribute}必须大于 “{compareValue}”。’,
60 ‘{attribute} must be greater than or equal to “{compareValue}”.’ => ‘{attribute}必须大于或者等于 “{compareValue}”。’,
61 ‘{attribute} must be less than “{compareValue}”.’ => ‘{attribute}必须小于 “{compareValue}”。’,
62 ‘{attribute} must be less than or equal to “{compareValue}”.’ => ‘{attribute}必须小于或者等于 “{compareValue}”。’,
63 ‘{attribute} must be {value}.’ => ‘{attribute}必须为{value}。’,
64 ‘{attribute} must not be equal to “{compareValue}”.’ => ‘{attribute}必须不等于”{compareValue}”。’,
65 ‘{className} does not support flushValues() functionality.’ => ‘{className} 不支持 flushValues() 功能。’,
66 ‘{class} does not have a method named “{name}”.’ => ‘{class} 没有名为 “{name}” 的方法。’,
67 ‘CDbLogRoute requires database table “{table}” to store log messages.’ => ‘@@CDbLogRoute 要求数据库 table “{table}” 储存日志讯息.@@’,
68 ‘CMemCache requires PHP memcache extension to be loaded.’ => ‘@@CMemCache 要求 PHP memcache extension 必须先被载入.@@’,
69 ‘CMultiFileUpload.name is required.’ => ‘@@CMultiFileUpload.name 是必要的.@@’,
70 ‘CSecurityManager.validation must be either “MD5” or “SHA1”.’ => ‘@@CSecurityManager.validation 必须是 “MD5” 或 “SHA1”.@@’,
71 ‘Cache table “{tableName}” does not exist.’ => ‘@@Cache table “{tableName}” 不存在.@@’,
72 ‘Table “{table}” does not have a primary key defined.’ => ‘@@Table “{table}” 没有定义主键.@@’,
73 ‘The “view” property is required.’ => ‘@@需要 “view” 属性@@’,
74 ‘The asset “{asset}” to be pulished does not exist.’ => ‘@@欲发布的 asset “{asset}” 不存在.@@’,
75 ‘The column “{column}” is not a foreign key in table “{table}”.’ => ‘@@栏位 “{column}” 并不是 table “{table}” 中的一个 foreign key.@@’,
76 ‘The pattern for day of the week must be “E”, “EE”, “EEE”, “EEEE” or “EEEEE”.’ => ‘@@代表 day of the week 的格式必须是 “E”, “EE”, “EEE”, “EEEE” 或 “EEEEE”.@@’,
77 ‘The pattern for month must be “M”, “MM”, “MMM”, or “MMMM”.’ => ‘@@代表月份的格式必须是 “M”, “MM”, “MMM”, 或 “MMMM”.@@’,
78 ‘The relation “{relation}” in active record class “{class}” is specified with an invalid foreign key “{key}”. The foreign key does not point to either joining table.’ => ‘@@active record class “{class}” 中的关联 “{relation}” 有一个无效的 foreign key “{key}”. foreign key 未指到任一个 joining table.@@’,
79 ‘The requested controller “{controller}” does not exist.’ => ‘@@请求的控制器 “{controller}” 不存在.@@’,
80 ‘The requested view “{name}” is not found.’ => ‘@@请求的 view “{name}” 未找到.@@’,
81 ‘The value for the primary key “{key}” is not supplied when querying the table “{table}”.’ => ‘@@查询 table “{table}” 时未提供 primary key “{key}” 的值.@@’,
82 ‘Unable to find the decorator view “{view}”.’ => ‘@@无法找到 decorator view “{view}”.@@’,
83 ‘Unable to find the list item.’ => ‘@@无法找到列表项目.@@’,
84 ‘{className} does not support flush() functionality.’ => ‘@@{className} 不支持 flush() 功能.@@’,
85 ‘{class} does not have attribute “{name}”.’ => ‘@@{class} 中没有名为 “{name}” 的属性.@@’,
86 ‘”{path}” is not a valid directory.’ => ‘”{path}” 不是一个合法的目录。’,
87 ‘< Previous’ => ‘< 前页’,
88 ‘<< First’ => ‘<< 首页’,
89 ‘Active Record requires a “db” CDbConnection application component.’ => ‘Active Record 需要一个名为 “db” 的 CDbConnection 应用程序组件。’,
90 ‘Active record “{class}” has an invalid configuration for relation “{relation}”. It must specify the relation type, the related active record class and the foreign key.’ => ‘Active record “{class}” 对于关联 “{relation}” 有一个无效的配置. 必须给定关联种类, 相关的 active record class 以及 foreign key。’,
91 ‘Active record “{class}” is trying to select an invalid column “{column}”. Note, the column must exist in the table or be an expression with alias.’ => ‘Active record “{class}” 正尝试选择一个无效的栏位 “{column}”. 注意, 该栏位必须存在于 table 中或者是一个具别名的 expression。’,
92 ‘Alias “{alias}” is invalid. Make sure it points to an existing directory or file.’ => ‘别名 “{alias}” 是无效的. 请确定它指向一个已存在的目录或文件。’,
93 ‘Application base path “{path}” is not a valid directory.’ => ‘应用程序基准路径 “{path}” 是无效的目录。’,
94 ‘Application runtime path “{path}” is not valid. Please make sure it is a directory writable by the Web server process.’ => ‘应用程序执行时的路径 “{path}” 是无效的. 请确定它是一个可被 Web server process 写入资料的目录。’,
95 ‘Authorization item “{item}” has already been assigned to user “{user}”.’ => ‘授权项目 “{item}” 已经被指派给使用者 “{user}”。’,
96 ‘CApcCache requires PHP apc extension to be loaded.’ => ‘CApcCache 要求 PHP apc extension 必须先被载入。’,
97 ‘CAssetManager.basePath “{path}” is invalid. Please make sure the directory exists and is writable by the Web server process.’ => ‘CAssetManager.basePath “{path}” 是无效的. 请确定它是一个可被 Web server process 写入资料的目录。’,
98 ‘CCacheHttpSession.cacheID is invalid. Please make sure “{id}” refers to a valid cache application component.’ => ‘CCacheHttpSession.cacheID 是无效的. 请确定 “{id}” 参照到一个有效的快取应用程序组件。’,
99 ‘CCaptchaValidator.action “{id}” is invalid. Unable to find such an action in the current controller.’ => ‘CCaptchaValidator.action “{id}” 是无效的. 无法在目前的控制器中找到此一动作。’,
100 ‘CDbAuthManager.connectionID “{id}” is invalid. Please make sure it refers to the ID of a CDbConnection application component.’ => ‘CDbAuthManager.connectionID “{id}” 是无效的. 请确定它参照到一个 CDbConnection 应用程序组件的 ID。’,
101 ‘CDbCache.connectionID “{id}” is invalid. Please make sure it refers to the ID of a CDbConnection application component.’ => ‘CDbCache.connectionID “{id}” 是无效的. 请确定它参照到一个 CDbConnection 应用程序组件的 ID。’,
102 ‘CDbCacheDependency.sql cannot be empty.’ => ‘CDbCacheDependency.sql 不能是空的。’,
103 ‘CDbCommand failed to execute the SQL statement: {error}’ => ‘CDbCommand 无法执行 SQL 语句: {error}’,
104 ‘CDbCommand failed to prepare the SQL statement: {error}’ => ‘CDbCommand 无法准备 SQL 语句: {error}’,
105 ‘CDbConnection does not support reading schema for {driver} database.’ => ‘CDbConnection 不支持对 {driver} 数据库 schema 的读取。’,
106 ‘CDbConnection failed to open the DB connection: {error}’ => ‘CDbConnection 无法开启数据库连线: {error}’,
107 ‘CDbConnection is inactive and cannot perform any DB operations.’ => ‘CDbConnection 状态为未启用, 无法进行任何数据库动作。’,
108 ‘CDbConnection.connectionString cannot be empty.’ => ‘CDbConnection.connectionString 不能是空的。’,
109 ‘CDbDataReader cannot rewind. It is a forward-only reader.’ => ‘CDbDataReader 无法倒回, 只允许向前读取。’,
110 ‘CDbHttpSession.connectionID “{id}” is invalid. Please make sure it refers to the ID of a CDbConnection application component.’ => ‘CDbHttpSession.connectionID “{id}” 是无效的. 请确定它参照到一个 CDbConnection 应用程序组件的 ID。’,
111 ‘CDbLogRoute.connectionID “{id}” does not point to a valid CDbConnection application component.’ => ‘CDbLogRoute.connectionID “{id}” 未指向一个有效的 CDbConnection 应用程序组件。’,
112 ‘CDbMessageSource.connectionID is invalid. Please make sure “{id}” refers to a valid database application component.’ => ‘CDbMessageSource.connectionID 是无效的. 请确定 “{id}” 参照到一个有效的数据库应用程序组件。’,
113 ‘CDbTransaction is inactive and cannot perform commit or roll back operations.’ => ‘CDbTransaction 状态为未启用, 无法进行 commit 或 roll back 动作。’,
114 ‘CDirectoryCacheDependency.directory cannot be empty.’ => ‘CDirectoryCacheDependency.directory 不能是空的。’,
115 ‘CFileCacheDependency.fileName cannot be empty.’ => ‘CFileCacheDependency.fileName 不能是空的。’,
116 ‘CFileLogRoute.logPath “{path}” does not point to a valid directory. Make sure the directory exists and is writable by the Web server process.’ => ‘CFileLogRoute.logPath “{path}” does not point to a valid directory. 请确定目录存在并且允许 Web server process 写入。’,
117 ‘CFilterChain can only take objects implementing the IFilter interface.’ => ‘CFilterChain 只能取得有实现 IFilter 接口的对象。’,
118 ‘CFlexWidget.baseUrl cannot be empty.’ => ‘CFlexWidget.baseUrl 不能是空的。’,
119 ‘CFlexWidget.name cannot be empty.’ => ‘CFlexWidget.name 不能是空的。’,
120 ‘CGlobalStateCacheDependency.stateName cannot be empty.’ => ‘CGlobalStateCacheDependency.stateName 不能是空的。’,
121 ‘CHttpCookieCollection can only hold CHttpCookie objects.’ => ‘CHttpCookieCollection 只能持有 CHttpCookie 对象。’,
122 ‘CHttpRequest is unable to determine the entry script URL.’ => ‘CHttpRequest 不能确认入口脚本的 URL。’,
123 ‘CHttpRequest is unable to determine the path info of the request.’ => ‘CHttpRequest 不能确认请求的路径信息。’,
124 ‘CHttpRequest is unable to determine the request URI.’ => ‘CHttpRequest 不能确认请求的 URI。’,
125 ‘CHttpSession.cookieMode can only be “none”, “allow” or “only”.’ => ‘CHttpSession.cookieMode 只能是 “none”, “allow” 或 “only”。’,
126 ‘CHttpSession.gcProbability “{value}” is invalid. It must be an integer between 0 and 100.’ => ‘CHttpSession.gcProbability “{value}” 是无效的. 它必须是介于 0 与 100之间的整数。’,
127 ‘CHttpSession.savePath “{path}” is not a valid directory.’ => ‘CHttpSession.savePath “{path}” 不是一个有效的目录。’,
128 ‘CMemCache server configuration must be an array.’ => ‘CMemCache 服务器配置必须是一个数组。’,
129 ‘CMemCache server configuration must have “host” value.’ => ‘CMemCache 服务器配置必须有 “host” 的值。’,
130 ‘CProfileLogRoute found a mismatching code block “{token}”. Make sure the calls to Yii::beginProfile() and Yii::endProfile() be properly nested.’ => ‘CProfileLogRoute found a mismatching code block “{token}”. 请确定对于 Yii::beginProfile() 与 Yii::endProfile() 的呼叫是适当地巢状套叠的。’,
131 ‘CProfileLogRoute.report “{report}” is invalid. Valid values include “summary” and “callstack”.’ => ‘CProfileLogRoute.report “{report}” 是无效的. 有效值包含 “summary” 与 “callstack”。’,
132 ‘CSecurityManager requires PHP mcrypt extension to be loaded in order to use data encryption feature.’ => ‘CSecurityManager 要求 PHP mcrypt extension 必须先被载入以便使用资料加密功能。’,
133 ‘CSecurityManager.encryptionKey cannot be empty.’ => ‘CSecurityManager.encryptionKey 不能是空的。’,
134 ‘CSecurityManager.validationKey cannot be empty.’ => ‘CSecurityManager.validationKey 不能是空的。’,
135 ‘CTypedList<{type}> can only hold objects of {type} class.’ => ‘CTypedList<{type}> 只能持有 {type} 类别的对象。’,
136 ‘CUrlManager.UrlFormat must be either “path” or “get”.’ => ‘CUrlManager.UrlFormat 必须是 “path” 或 “get”。’,
137 ‘CXCache requires PHP XCache extension to be loaded.’ => ‘CXCache 要求 PHP XCache extension 必须先被载入。’,
138 ‘Cannot add “{child}” as a child of “{name}”. A loop has been detected.’ => ‘无法新增 “{child}” 成为 “{name}” 的子项. 侦测到有迴圈产生。’,
139 ‘Cannot add “{child}” as a child of “{parent}”. A loop has been detected.’ => ‘无法新增 “{child}” 成为 “{parent}” 的子项. 侦测到有迴圈产生。’,
140 ‘Cannot add “{name}” as a child of itself.’ => ‘无法新增 “{name}” 成为它自己的子项。’,
141 ‘Cannot add an item of type “{child}” to an item of type “{parent}”.’ => ‘无法新增一个种类为 “{child}” 的项目到一个种类为 “{parent}” 的项目。’,
142 ‘Either “{parent}” or “{child}” does not exist.’ => ‘”{parent}” 或 “{child}” 不存在。’,
143 ‘Error: Table “{table}” does not have a primary key.’ => ‘错误: Table “{table}” 没有定义主键。’,
144 ‘Error: Table “{table}” has a composite primary key which is not supported by crud command.’ => ‘错误: Table “{table}” 有一个不被 crud 命令所支持的合成主键。’,
145 ‘Event “{class}.{event}” is attached with an invalid handler “{handler}”.’ => ‘事件 “{class}.{event}” 附加了一个无效的 handler “{handler}”。’,
146 ‘Event “{class}.{event}” is not defined.’ => ‘事件 “{class}.{event}” 未定义。’,
147 ‘Failed to write the uploaded file “{file}” to disk.’ => ‘无法将已上传的文件 “{file}” 写入磁碟。’,
148 ‘File upload was stopped by extension.’ => ‘文件上传被 extension 所停止。’,
149 ‘Filter “{filter}” is invalid. Controller “{class}” does have the filter method “filter{filter}”.’ => ‘筛选器 “{filter}” 是无效的. 控制器 “{class}” 没有名为 “filter{filter}” 的筛选器方法。’,
150 ‘Get a new code’ => ‘取得一组新代码’,
151 ‘Go to page: ‘ => ‘翻页: ‘,
152 ‘Invalid MO file revision: {revision}.’ => ‘无效的 MO 文件修订: {revision}。’,
153 ‘Invalid MO file: {file} (magic: {magic}).’ => ‘无效的 MO 文件: {file} (magic: {magic})。’,
154 ‘Invalid enumerable value “{value}”. Please make sure it is among ({enum}).’ => ‘无效的 enumerable 值 “{value}”. 请确定它在 ({enum}) 之中。’,
155 ‘Last >>’ => ‘末页 >>’,
156 ‘List data must be an array or an object implementing Traversable.’ => ‘列表资料必须是一个数组或是有实现 Traversable 的一个对象。’,
157 ‘List index “{index}” is out of bound.’ => ‘列表索引 “{index}” 超出范围。’,
158 ‘Login Required’ => ‘需要先登入系统’,
159 ‘Map data must be an array or an object implementing Traversable.’ => ‘哈希表资料必须是一个数组或一个实现 Traversable 的对象。’,
160 ‘Missing the temporary folder to store the uploaded file “{file}”.’ => ‘缺乏暂存目录来储存已上传的文件 “{file}”。’,
161 ‘Next >’ => ‘后页 >’,
162 ‘No columns are being updated for table “{table}”.’ => ‘table “{table}” 没有任何栏位将被更新。’,
163 ‘No counter columns are being updated for table “{table}”.’ => ‘table “{table}” 没有任何计数器栏位将被更新。’,
164 ‘Object configuration must be an array containing a “class” element.’ => ‘对象配置必须是内含有一个 “class” 元素的一个数组。’,
165 ‘Please fix the following input errors:’ => ‘请更正下列输入错误:’,
166 ‘Property “{class}.{property}” is not defined.’ => ‘属性 “{class}.{property}” 未被定义。’,
167 ‘Property “{class}.{property}” is read only.’ => ‘属性 “{class}.{property}” 是只读的。’,
168 ‘Queue data must be an array or an object implementing Traversable.’ => ‘队列资料必须是一个数组或一个实现 Traversable 的对象。’,
169 ‘Relation “{name}” is not defined in active record class “{class}”.’ => ‘关联 “{name}” 未被定义在 active record class “{class}” 中。’,
170 ‘Stack data must be an array or an object implementing Traversable.’ => ‘堆栈资料必须是一个数组或一个实现 Traversable 的对象。’,
171 ‘Table “{table}” does not have a column named “{column}”.’ => ‘Table “{table}” 没有名为 “{column}” 的栏位。’,
172 ‘The “filter” property must be specified with a valid callback.’ => ‘属性 “filter” 必须以一个有效的 callback 指明。’,
173 ‘The “pattern” property must be specified with a valid regular expression.’ => ‘属性 “pattern” 必须以一个有效的 regular expression 指明。’,
174 ‘The CSRF token could not be verified.’ => ‘CSRF token 无法被验证。’,
175 ‘The URL pattern “{pattern}” for route “{route}” is not a valid regular expression.’ => ‘route “{route}” 中的 URL 格式 “{pattern}” 不是有效的 regular expression。’,
176 ‘The active record cannot be deleted because it is new.’ => ‘active record 由于是新的, 无法被删除。’,
177 ‘The active record cannot be inserted to database because it is not new.’ => ‘active record 由于不是新的, 无法被新增到数据库。’,
178 ‘The active record cannot be updated because it is new.’ => ‘active record 由于是新的, 无法被更新。’,
179 ‘The asset “{asset}” to be published does not exist.’ => ‘Asset文件 “{asset}” 不存在。’,
180 ‘The command path “{path}” is not a valid directory.’ => ‘命令路径 “{path}” 不是一个有效的目录。’,
181 ‘The controller path “{path}” is not a valid directory.’ => ‘控制器路径 “{path}” 不是一个有效的目录。’,
182 ‘The file “{file}” cannot be uploaded. Only files with these extensions are allowed: {extensions}.’ => ‘文件 “{file}” 无法被上传. 只有附档名如下的文件是被允许的: {extensions}。’,
183 ‘The file “{file}” is too large. Its size cannot exceed {limit} bytes.’ => ‘文件 “{file}” 太大. 文件大小不能超过 {limit} 位元组。’,
184 ‘The file “{file}” is too small. Its size cannot be smaller than {limit} bytes.’ => ‘文件 “{file}” 太小. 文件大小不能少于 {limit} 位元组。’,
185 ‘The file “{file}” was only partially uploaded.’ => ‘文件 “{file}” 上传不完全。’,
186 ‘The first element in a filter configuration must be the filter class.’ => ‘筛选器配置中的第一个元素必须是筛选器类别。’,
187 ‘The item “{name}” does not exist.’ => ‘项目 “{name}” 不存在。’,
188 ‘The item “{parent}” already has a child “{child}”.’ => ‘项目 “{parent}” 已有子项目 “{child}”。’,
189 ‘The layout path “{path}” is not a valid directory.’ => ‘布局路径 “{path}” 不是一个有效的目录。’,
190 ‘The list is read only.’ => ‘列表是只读的。’,
191 ‘The map is read only.’ => ‘哈希表是只读的。’,
192 ‘The pattern for 12 hour format must be “h” or “hh”.’ => ‘代表12小时制的格式必须是 “h” 或 “hh”。’,
193 ‘The pattern for 24 hour format must be “H” or “HH”.’ => ‘代表24小时制的格式必须是 “H” 或 “HH”。’,
194 ‘The pattern for AM/PM marker must be “a”.’ => ‘代表 AM/PM 标记的格式必须是 “a”。’,
195 ‘The pattern for day in month must be “F”.’ => ‘代表 day in month 的格式必须是 “F”。’,
196 ‘The pattern for day in year must be “D”, “DD” or “DDD”.’ => ‘代表 day in year 的格式必须是 “D”, “DD” 或 “DDD”。’,
197 ‘The pattern for day of the month must be “d” or “dd”.’ => ‘代表 day of the month 的格式必须是 “d” 或 “dd”。’,
198 ‘The pattern for era must be “G”, “GG”, “GGG”, “GGGG” or “GGGGG”.’ => ‘代表年代的格式必须是 “G”, “GG”, “GGG”, “GGGG” 或 “GGGGG”。’,
199 ‘The pattern for hour in AM/PM must be “K” or “KK”.’ => ‘代表时(AM/PM格式)的格式必须是 “K” 或 “KK”。’,
200 ‘The pattern for hour in day must be “k” or “kk”.’ => ‘代表该天第几小时的格式必须是 “k” 或 “kk”。’,
201 ‘The pattern for minutes must be “m” or “mm”.’ => ‘代表分的格式必须是 “m” 或 “mm”。’,
202 ‘The pattern for seconds must be “s” or “ss”.’ => ‘代表秒的格式必须是 “s” 或 “ss”。’,
203 ‘The pattern for time zone must be “z” or “v”.’ => ‘代表时区的格式必须是 “z” 或 “v”。’,
204 ‘The pattern for week in month must be “W”.’ => ‘代表 week in month 的格式必须是 “W”。’,
205 ‘The pattern for week in year must be “w”.’ => ‘代表 week in year 的格式必须是 “w”。’,
206 ‘The queue is empty.’ => ‘队列状态为空。’,
207 ‘The relation “{relation}” in active record class “{class}” is not specified correctly: the join table “{joinTable}” given in the foreign key cannot be found in the database.’ => ‘active record class “{class}” 中的关联 “{relation}” 未被正确指明: 数据库中无法找到 foreign key 中所给的 join table “{joinTable}”。’,
208 ‘The relation “{relation}” in active record class “{class}” is specified with an incomplete foreign key. The foreign key must consist of columns referencing both joining tables.’ => ‘active record class “{class}” 中的关联 “{relation}” 有一个不完整的 foreign key. foreign key 必须是参照 joining tables 中的栏位所构成。’,
209 ‘The relation “{relation}” in active record class “{class}” is specified with an invalid foreign key. The format of the foreign key must be “joinTable(fk1,fk2,…)”.’ => ‘active record class “{class}” 中的关联 “{relation}” 有一个无效的 foreign key. foreign key 的格式必须是 “joinTable(fk1,fk2,…)”。’,
210 ‘The stack is empty.’ => ‘堆栈状态为空。’,
211 ‘The system is unable to find the requested action “{action}”.’ => ‘系统无法找到请求的 “{action}” 动作。’,
212 ‘The system view path “{path}” is not a valid directory.’ => ‘系统 view 路径 “{path}” 不是一个有效的目录。’,
213 ‘The table “{table}” for active record class “{class}” cannot be found in the database.’ => ‘数据库中无法找到 active record class “{class}” 对应的 table “{table}”。’,
214 ‘The verification code is incorrect.’ => ‘验证码不正确。’,
215 ‘The view path “{path}” is not a valid directory.’ => ‘view 路径 “{path}” 不是一个有效的目录。’,
216 ‘Theme directory “{directory}” does not exist.’ => ‘Theme 目录 “{directory}” 不存在。’,
217 ‘This content requires the Adobe Flash Player.’ => ‘内容需有 Adobe Flash Player。’,
218 ‘Unable to add an item whose name is the same as an existing item.’ => ‘无法新增与已存在项目名称相同的新项目。’,
219 ‘Unable to change the item name. The name “{name}” is already used by another item.’ => ‘无法变更项目名称. 名称 “{name}” 已被其它项目使用。’,
220 ‘Unable to create application state file “{file}”. Make sure the directory containing the file exists and is writable by the Web server process.’ => ‘无法产生应用程序状态文件 “{file}”. 请确认存放此文件的目录存在并且允许 Web server process 写入。’,
221 ‘Unable to lock file “{file}” for reading.’ => ‘无法锁定文件 “{file}” 进行读取。’,
222 ‘Unable to lock file “{file}” for writing.’ => ‘无法锁定文件 “{file}” 进行写入。’,
223 ‘Unable to read file “{file}”.’ => ‘无法读取文件 “{file}”。’,
224 ‘Unable to replay the action “{object}.{method}”. The method does not exist.’ => ‘无法再次重演 “{object}.{method}” 动作. 这个方法不存在。’,
225 ‘Unable to write file “{file}”.’ => ‘无法写入文件 “{file}”。’,
226 ‘Unknown authorization item “{name}”.’ => ‘未知的授权项目 “{name}”。’,
227 ‘Unrecognized locale “{locale}”.’ => ‘无法辨识的地区设定 “{locale}”。’,
228 ‘View file “{file}” does not exist.’ => ‘名为 “{file}” 的 View 档不存在。’,
229 ‘Yii application can only be created once.’ => ‘Yii 应用程序只能被产生一次。’,
230 ‘You are not authorized to perform this action.’ => ‘您未被授权执行这个动作’,
231 ‘Your request is not valid.’ => ‘您的请求无效’,
232 ‘{attribute} “{value}” has already been taken.’ => ‘{attribute} “{value}” 已被取用。’,
233 ‘{attribute} cannot be blank.’ => ‘{attribute} 不可为空白。’,
234 ‘{attribute} is invalid.’ => ‘{attribute} 无效。’,
235 ‘{attribute} is not a valid URL.’ => ‘{attribute} 不是有效的 URL。’,
236 ‘{attribute} is not a valid email address.’ => ‘{attribute} 不是有效的电子邮件地址。’,
237 ‘{attribute} is not in the list.’ => ‘{attribute} 不在列表之中。’,
238 ‘{attribute} is of the wrong length (should be {length} characters).’ => ‘{attribute} 长度错误 (应为 {length} 字符串)。’,
239 ‘{attribute} is too big (maximum is {max}).’ => ‘{attribute} 数值太大 (最大值为 {max})。’,
240 ‘{attribute} is too long (maximum is {max} characters).’ => ‘{attribute} 太长 (最大值为 {max} 字符串)。’,
241 ‘{attribute} is too short (minimum is {min} characters).’ => ‘{attribute} 太短 (最小值为 {min} 字符串)。’,
242 ‘{attribute} is too small (minimum is {min}).’ => ‘{attribute} 数值太小 (最小值为 {min})。’,
243 ‘{attribute} must be a number.’ => ‘{attribute} 必须为数字。’,
244 ‘{attribute} must be an integer.’ => ‘{attribute} 必须为整数。’,
245 ‘{attribute} must be repeated exactly.’ => ‘{attribute} 必须被重复。’,
246 ‘{attribute} must be {type}.’ => ‘{attribute} 必须为 {type}。’,
247 ‘{className} does not support add() functionality.’ => ‘{className} 不支持 add() 功能。’,
248 ‘{className} does not support delete() functionality.’ => ‘{className} 不支持 delete() 功能。’,
249 ‘{className} does not support get() functionality.’ => ‘{className} 不支持 get() 功能。’,
250 ‘{className} does not support set() functionality.’ => ‘{className} 不支持 set() 功能。’,
251 ‘{class} does not have relation “{name}”.’ => ‘{class} 中没有名为 “{name}” 的关联。’,
252 ‘{class} does not support fetching all table names.’ => ‘{class} 不支持撷取所有 table 名称。’,
253 ‘{class} has an invalid validation rule. The rule must specify attributes to be validated and the validator name.’ => ‘{class} 有一个无效的确认规则. 规则必须指明要被确认的属性以及确认器名称。’,
254 ‘{class} must specify “model” and “attribute” or “name” property values.’ => ‘{class} 必须给定 “model” 与 “attribute” 或 “name” 属性值。’,
255 ‘{class}.allowAutoLogin must be set true in order to use cookie-based authentication.’ => ‘{class}.allowAutoLogin 必须设为 true 才能使用 cookie-based 认证。’,
256 ‘{class}::authenticate() must be implemented.’ => ‘{class}::authenticate() 必须被实现。’,
257 ‘{controller} cannot find the requested view “{view}”.’ => ‘{controller} 无法找到请求的视图 “{view}”。’,
258 ‘{controller} contains improperly nested widget tags in its view “{view}”. A {widget} widget does not have an endWidget() call.’ => ‘{controller} 在它的 view “{view}” 中含有未被适当巢状套叠的 widget 标签. {widget} widget 中没有呼叫 endWidget()。’,
259 ‘{controller} has an extra endWidget({id}) call in its view.’ => ‘{controller} 在它的视图中有一个额外的 endWidget({id}) 呼叫。’,
260 ‘{widget} cannot find the view “{view}”.’ => ‘{widget} 无法找到这个视图 “{view}”。’,
261 );

zii.php
1 /**
2 * Message translations.
3 *
4 * This file is automatically generated by ‘yiic message’ command.
5 * It contains the localizable messages extracted from source code.
6 * You may modify this file by translating the extracted messages.
7 *
8 * Each array element represents the translation (value) of a message (key).
9 * If the value is empty, the message is considered as not translated.
10 * Messages that no longer need translation will have their translations
11 * enclosed between a pair of ‘@@’ marks.
12 *
13 * NOTE, this file must be saved in UTF-8 encoding.
14 *
15 * @version $Id: $
16 */
17 return array (
18 ‘Home’ => ‘首页’,
19 ‘The button type “{type}” is not supported.’ => ‘按钮类型 “{type}” 不支持。’,
20 ‘Are you sure you want to delete this item?’ => ‘确定要删除这条数据吗?’,
21 ‘Delete’ => ‘删除’,
22 ‘Displaying {start}-{end} of {count} result(s).’ => ‘第 {start}-{end} 条, 共 {count} 条。’,
23 ‘Either “name” or “value” must be specified for CDataColumn.’ => ‘CDataColumn 必须指定 “name” 或 “value” 至少一项。’,
24 ‘No results found.’ => ‘没有找到数据。’,
25 ‘Not set’ => ‘未设置’,
26 ‘Please specify the “attributes” property.’ => ‘请指定 “attributes” 属性。’,
27 ‘Please specify the “data” property.’ => ‘请指定 “data” 属性。’,
28 ‘Sort by: ‘ => ‘排序: ‘,
29 ‘The “dataProvider” property cannot be empty.’ => ‘”dataProvider” 属性不能为空。’,
30 ‘The attribute must be specified in the format of “Name:Type:Label”, where “Type” and “Label” are optional.’ => ‘属性格式 “Name:Type:Label”, “Type” 和 “Label” 为可选项。’,
31 ‘The column must be specified in the format of “Name:Type:Label”, where “Type” and “Label” are optional.’ => ‘栏位格式 “Name:Type:Label”, “Type” 和 “Label” 为可选项。’,
32 ‘The property “itemView” cannot be empty.’ => ‘必须指定 “itemView” 属性。’,
33 ‘Total {count} result(s).’ => ‘共 {count} 条。’,
34 ‘Update’ => ‘更新’,
35 ‘View’ => ‘查看’,
36 ‘{class} must specify “model” and “attribute” or “name” property values.’ => ‘{class} 必须给定 “model” 与 “attribute” 或 “name” 属性值。’,
37 );
此条目发表在 常见问题解答 分类目录。将固定链接加入收藏夹。

PHP変数出力関数

PHP自分持っている情報出力用変数
print_r:
mixed print_r ( mixed $expression [, bool $return = false ] )

print_r() は、 変数の値に関する情報を解り易い形式で表示します。

print_r()、var_dump() および var_export() は、PHP 5 においてオブジェクトの protected および private のプロパティも表示します。 静的なクラスメンバーは表示されません。

print_r() は、配列ポインタを終端まで移動する ことに注意してください。ポインタを最初に戻すために reset() を使用してください。
—————————————————-

var_dump:
void var_dump ( mixed $expression [, mixed $… ] )
この関数は、指定した式に関してその型や値を含む構造化された情報を 返します。配列の場合、その構造を表示するために各値について再帰的に 探索されます。

PHP 5 では、オブジェクトのすべての public、private および protected なプロパティが出力されます。

—————————————————-
var_export:
mixed var_export ( mixed $expression [, bool $return = false ] )
var_export() は、 渡された変数に関する構造化された情報を返します。この関数は var_dump() に似ていますが、 返される表現が有効な PHP コードであるところが異なります。

CVarDumper::dump($apps, 10, true); <-YII特有
—————————————————-
dump() method
public static void dump(mixed $var, integer $depth=10, boolean $highlight=false)
$var mixed variable to be dumped
$depth integer maximum depth that the dumper should go into the variable. Defaults to 10.
$highlight boolean whether the result should be syntax-highlighted
Source Code: framework/utils/CVarDumper.php#41 (show)

Displays a variable. This method achieves the similar functionality as var_dump and print_r but is more robust when handling complex objects such as Yii controllers.

php save content to html

http://code.google.com/p/queryphp/downloads/list

—————————————————–

目前网络上好多网站的新闻发布系统都采用了动态服务器技术生成静态HTML的做法,这样做的好处是:一是能减轻其服务器的负担,二是因为生成了HTML静态页面,所以其网站被搜索引擎搜索到的机率更大一些。笔者的网站曾经使用PHP这一动态技术来构建新闻发布系统,其原理也就是应用了PHP生成HTML静态页面的技术,相关平台是 Windows XP Sp2+php4.32+mysql,因此,在这里,想简单地谈一下这种做法的思路。这篇文章适合于对PHP+MYSQL数据库操作,SQL语句以及网页设计有点基础的朋友,如果您是一个从头开始学的朋友,那么请先打好基础吧!到这里就不用往下看了。如果您都符合上述条件的话,那么恭喜您,请接着往下看。但是,在具体动手构建之前,您还要做好以下几点准备工作。

一、 具备本地调试PHP的功能

在WINDOWS XP操作系统下,笔者建议你可以到网上下载一个PHP+MYSQL+APHCHE的服务器套装,如华军软件园,去那里搜索一下就可以下载到。下载完后默认安装即可,这样您就具备了在本地测试PHP的功能了,省去了很多手动配置的麻烦,怎么样,简单吧,OK,这仅仅只是第一步。

二、 构思新闻发布系统所具备的功能

首页的新闻发布往往是通过后台更新的,后台的更新无非是由添加、编辑、删除数据等基本的功能所实现的。在这里,你可以使用网页设计软件来构建你的想要的后台界面,其功能的实现当然是要用到PHP喽。这一步建议您先想好新闻发布系统要有的功能。在这里,如何用PHP添加、编辑、删除数据就不再重复,因为重点是如何在这基础上生成静态技术。

三、 PHP生成HTML的技术原理。

哈哈。费话说了那么多,终于到了该讲的地方了。其实,这一原理并不复杂,综合地来讲的话,应该是PHP中一个替换数据语法的应用。OK,讲一个简单范例吧,一步一步地分析!相信聪明的你能看得明白的咯,仔细看好每一步即可,在这里,只是引导大家如何做而已,具体的可以实践一下!

(1)在MYSQL里新建一数据库,命名为 database (可自定义),新建一表,命名为 news(因为是新闻发布嘛,取个好记的名字即可,可自定义),然后建立这几个字段名:
id (自动递增,这是关键,类型:INT)
title (顾名思义,新闻标题,类型可取 TEXT)
content (新闻内容,类型可取 TEXT)
path (HTML文件路径,类型可取 TEXT)

(2)建立 conn.php
这是连接数据库的PHP文件,你可以把连接数据的语句单独放在这一文件里,以后多个需要连接数据库的文件直接引用这个文件即可。

(3)设计添加新闻的表格 add.form 简单的源代码如下:

   

//提交至 add.php
新闻标题:

新闻内容:


//提交至 add.php
新闻标题:

新闻内容:


    
(4)建立一个 HTML 的模板,另存为model.htm,和 add.php可以在同一目录下。
示例源代码:


此新闻的标题:{title}
此新闻的内容:{content}


{ }大括号内的内容即是要被替换的内容,整个静态模板的设计可以根据自己的思路,但{ }内被替换的内容必须包含在内,如上面的{title},{content};咔咔~简单地说,设计好一个很好看的新闻模板后,把要被替换的如{title},{content}等标记放到需要的地方就可以了撒。

(5)详解 add.php 源码

< ?php
require_once(“conn.php”); //引用conn.php,连接数据库
$title=$_POST[“title”];
$content=$_POST[“content”]; //获得表单变量

//以下建立一文本文档,其值自动计数
$countfile= “count.txt “;
if(!file_exists($countfile))
{
fopen($countfile, “w “); //如果此文件不存在,则自动建立一个
}
$fp=fopen($countfile, “r “);
$num=fgets($fp,20);
$num=$num+1; //每次其值自动加一
fclose($fp);
$fp=fopen($countfile, “w “);
fwrite($fp,$num); //更新其值
fclose($fp);

//利用上面自动计数的值获得HTML的路径$path
$houzui=”.html”;
$path=$num.$houzui;
//这样形成的路径是自动增长的,如1.html,2.html,3.html……….添加一条新闻便自动加上1

//以下用SQL语句添加数据至表 news

$sql=”insert into news (title,content,path) values (‘”.$title.”’,’”.$content.”’,’”.$path.”’)”;
$query=mysql_query($sql);

//以下为关键之处,把从表单获得的数据替换模板中的{title},{content}标记

$fp=fopen(“model.htm”,”r”) //只读打开模板
$str=fread($fp,filesize(“mode.htm”));//读取模板中内容
$str=str_replace(“{title}”,$title,$str);
$str=str_replace(“{content}”,$content,$str);//替换内容
fclose($fp);

$handle=fopen($path,”w”); //写入方式打开新闻路径
fwrite($handle,$str); //把刚才替换的内容写进生成的HTML文件
fclose($handle);

//收尾工作:

echo “ 查看刚才添加的新闻 ”;

OK,整个生成HTML的示例源码就到这里,其关键是用了替换的方法。
$str=str_replace(“{被替换的内容}”,$替换的内容,$str);

因此,总结一下以上的做法:先设计好新闻模板,把需要被替换的内容用{ }放到模板中相应的位置,然后设计表单,再是最后的表单处理程序,把从表单中获取的变量替换模板中相应的内容即可,这样每次都会生成不同的HTML;如果需要修改HTML的内容也是一样的,获得修改后的表单内容后,先用 update 语句更新数据库,再重新替换一下模板中的内容即可;删除的话,先delete表中要删除的内容,再用unlink($path) 来删除HTML的物理文件即可。

続きを読む

mac xdebug 设定方法

在mac下的Mamp使用xdebug调试php
( 2010-12-12 )
很久之前在windows下用 xampp 时用 xdebug 很方便. 现在用mac,用mamp已经很久没用过xdebug了,今天突然需要用到,找了找如何安装使用,简单分享一下.

1. 先下载xdebug模块吧,地址如下http://aspn.activestate.com/ASPN/Downloads/Komodo/RemoteDebugging , 里面有mac版本,找个最新的版本下载就好.

2. 下载后打开,里面有好几个目录,注意选择和你的php版本对应的目录, 我的php是5.2.*, 所以打开 5.2 这个目录, 把这个目录下的 xdebug.so 考到 /Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613, 注意目录里最后这个日期可能会因为版本的不同而不同,您需要先查看一下您的目录.

3. 编辑php配置文件 /Applications/MAMP/conf/php5/php.ini , 注意如果用 spotlight 找 php.ini 的话,会找到多个,千万别选成 php4 下的.
增加下面两行

[xdebug]
zend_extension=/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so
还是要注意那个目录最后的日期,不要写错了. 如果已经存在这行了,那就把最前面的 ; 去掉就行了.
4. 重启一下 Mamp , 然后看看 phpinfo 吧. 应该已经可以用了:)
5. 喝水不忘挖井人, 上面几条都是跟这篇文章学的
http://debuggable.com/posts/setting-up-xdebug-on-mac-os-x-or-win32-linux:480f4dd6-0240-4a90-8fa1-4e41cbdd56cb

转载:http://ifaint.com/2010/12/xdebug_in_mamp_macox/

Jquery FullCalendar(参数中文说明)

var st_d = new Date(); //获取系统时间
var y = st_d.getFullYear();
var m = st_d.getMonth();
var d = st_d.getDay();
$('#calendar').fullCalendar({
defaultView:"month", // year, month, date: 整数, 初始化加载时的日期,默认是month
height: 600, // 日历高度,包括表头 contentHeight: 600 内容高度,不包括表头
editable: true, // 默认值false, 用来设置日历中的日程是否可以编辑
draggable: true, // 是否可拖动
weekends: true, // 默认为true, 标识是否显示周六和周日的列
slotMinutes:30, // 整型, 默认值30, 表示在agenda的views中, 两个时间之间的间隔
disableDragging:false, // Boolean类型, 默认false, 所有的event可以拖动, 必须editable = true
diableResizing:false, // Boolean, 默认false, 所有的event可以改变大小, 必须editable = true
dragRevertDuration:500, // 拖动恢复的时间, 默认500毫秒, 表示一个不成功的拖动之后, 控件回复到原始位置的时间.
dragOpacity:.5, // Float类型, 表示拖动时候的不透明度.
monthNames:['一月','二月', '三月', '四月', '五月', '六月', '七月','八月', '九月', '十月', '十一月', '十二月'], //默认为英文月分,这里可以改成中文
dayNames:['星期日', '星期一', '星期二', '星期三','星期四', '星期五', '星期六'], //换成中文星期
header:{
left: 'month,agendaWeek,agendaDay', //左边显示的按钮 (month,basicWeek无时间格式,basicDay无时间格式,agendaWeek,agendaDay)
center: 'title', //中间显示标题
right: 'prevYear,prev,today,next,nextYear' //右边显示的按钮
},
buttonText:{ //按钮对应的文本
prevYear: '去年', //不建议改这个值,因为它本身是含[去年、上一周、前天]三个意思,你就让它默认
nextYear: '明年', //同上
today: '今天',
month: '月',
week: '周',
day: '日'
},
dayNamesShort:['周日', '周一', '周二', '周三','周四', '周五', '周六'], //短格式的星期
titleFormat:{ //格式化标题
month: 'MMMM yyyy', // 如:September 2009
week: "MMM d[yyyy]{'—'[ MMM] d yyyy}", // 如:Sep 7 - 13 2009
day: 'dddd, MMM d, yyyy' // 如:Tuesday, Sep 8, 2009
},
weekMode:'fixed', //固定显示6周高
dayClick:function(dayDate, allDay, jsEvent, view){ //点击单元格事件
alert(dayDate.getFullYear()+"-"+dayDate.getMonth()+"-"+dayDate.getDate()+"-星期:"+dayDate.getDay()+ "视图:"+view.name);
//$('#calendar').fullCalendar("incrementDate", -1, 0, 0); //移动日历 后三个参数为 年 月 日
//$('#calendar').fullCalendar("prev"); // 跳转到前一月/周/天, 根据当前的view决定
//$('#calendar').fullCalendar("next"); // 跳转到下一月/周/天, 根据当前的view决定
//$('#calendar').fullCalendar("today"); // 跳转今天
//$('#calendar').fullCalendar("gotoDate", year[, month[, date]]); //跳转到指定的日期
//$('#calendar').fullCalendar("changeView","viewName"); //切换日历的view, viewName必须是允许的views
},
eventClick: function(event, jsEvent, view) { //当点击某一个事件时触发此操作
//return false; //可以阻止浏览器跳转到对应日程事件在初始配置时指定的url地址
//alert('事件: ' + event.title+'View: ' + view.name);
//alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
//event.title = "CLICKED!";
//$('#calendar').fullCalendar('updateEvent', event); //更新对应的事件
//$("#calendar").fullCalendar("removeEvents",event.id); //删除对应的事件,指定ID,没指定时删除所有事件
//$("#calendar").fullCalendar("clientEvents",event.id); //返回FullCalendar已经存储到客户端的CalEvents对象数组---------
//$("#calendar").fullCalendar("addEventSource","json.json"); //添加一个日程事件源
//$("#calendar").fullCalendar("removeEventSource","json.json"); //移除一个日程事件源
//$("#calendar").fullCalendar("rerenderEvents"); //重新渲染屏幕上的所有日程事件(效果不明显)
//$("#calendar").fullCalendar("refetchEvents"); // 重新抓取所有的日程事件源上的日程事件并渲染它们
//$("#calendar").fullCalendar("render"); // 该方法用来立刻渲染整个日历
$(this).css('background-color', 'red');
var eve={};
eve.title="新事件";
eve.id="1000";
eve.start="2011-10-10";
eve.end="2011-10-11";
$('#calendar').fullCalendar('renderEvent', eve); //添加新的事件,些方法适合更改事件动作
},
eventMouseover:function( event, jsEvent, view ) { //当鼠标悬停在一个事件上触发此操作
},
eventMouseout:function( event, jsEvent, view ) { //当鼠标从一个事件上移开触发此操作
},
eventDragStart:function(calEvent, jsEvent, ui, view) { //日程事件被拖动之前触发
},
eventDragStop:function(calEvent, jsEvent, ui, view) { //日程事件被拖动之后触发
},
eventDrop: function(event, delta, minuteDelta, allDay, revertFunc, jsEvent, ui, view) {//停止拖动事件后 view.name=[month,agendaWeek,agendaDay]
//allDay:true,false 是否是全天事件
var s;
if(delta!=0)
s=delta>0?"推迟了"+delta+"天":"提前了"+delta+"天";
if(minuteDelta!=0)
s=minuteDelta>0?"推迟了"+delta+"分钟":"提前了"+minuteDelta+"分钟";
alert("事件:"+ event.id + "-" + event.title + s);
//updateEvent: $(".selector").fullCalendar("updateEvent", calEvent); //更新日历空间中的一个日程事件
//renderEvent: $(".selector").fullCalendar("renderEvent", calEvent, [stick]); //新渲染事件
//removeEvents: $(".selector").fullCalendar("removeEvents",1); //从日历中删除一个日程事件.
},
eventResize:function( event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, view ) { //改变大小后触发的事件
alert(event.title+"事件调整了分钟:"+minuteDelta);
},
eventRender:function(calEvent, element, view){ //日程事件渲染之前触发,每个事件触发一次
//return false; //可以阻止日程事件渲染
},
events: [
{ id: 1, title: "更多", start: "2011-10-09",allDay : false},
{ id: 2, title: "我的事件", start: new Date(y, m, 9), end: new Date(y, m, 9)},
{ id: 3, title: "我的活动", start: new Date(y, m, 9,10,30), end: new Date(y, m, 9,12,30)},
{ id: 4, title: "查看facebook", start: new Date(y, m, 9, 16),end: new Date(y, m, 29)}
]
//,events:"json.asp" //可以使用json格式源
});

http://www.scscms.com/article/2011-10/2116552684.html