1.如何开发‘xhtml-mp’的页面?只需在布局模板头部修改成下面这样即可。注意下面第二行的,必须打印,否则php会混淆‘<?’的标记,编译出错。
<?php header('Content-type: application/vnd.wap.xhtml+xml');?>
<?php echo '<?xml version="1.0" encoding="utf-8"?>';?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>...
2.一个构思很酷的函数a()00210 /**
00211 * Returns an array of all the given parameters.
00212 *
00213 * Example:
00214 *
00215 * a('a', 'b')
00216 *
00217 *
00218 * Would return:
00219 *
00220 * array('a', 'b')
00221 *
00222 *
00223 * @return array Array of given parameters
00224 */
00225 function a() {
00226 $args = func_get_args();
00227 return $args;
00228 }
3.我安装cakephp1.2出现的问题
3.1. .php文件无法执行
解决办法:将php的目录添加到系统环境变量中去。
3.2. 找不到php_exif.dll的扩展
原因是必须在php_mbstring.dll之后加载再加载php_exif.dll。php_exif.dll(EXIF 函数库)需要php_mbstring.dll,并且在 php.ini中,php_exif.dll必须在php_mbstring.dll之后加载。
4.cake bake的几个常用方法(cakephp1.2,已将.../cake/console添加windows环境变量)
创建新的应用,名为baz
cake bake baz
创建model(以下均需cmd到目录:D:\wamp\www\cake\baz(windows))
cake bake model [model name]
创建controller
cake bake controller Users
使用脚手架。额外创建:index, add, view, edit, and delete方法
cake bake controller Users scaffold
带有admin_index, admin_add, admin_view, admin_edit and admin_delete的脚手架
cake bake controller Users scaffold admin
创建视图
cake bake view Users
5.cakephp中取消方法vendor(),改为App::import('Vendor' , '...');Description
The code I had before was
vendor('Swift');
vendor('EasySwift');
vendor('Swift/Connection/SMTP');
But the latest nightly told me "(vendor) Deprecated, see App::import('Vendor', '...');". So I modified my code to say
App::import('Vendor', 'Swift');
App::import('Vendor', 'EasySwift');
App::import('Vendor', 'Swift/Connection/SMTP');
Unfortunately, the classes no longer loaded. I did some poking around and it seems that App::import('Vendor', ...) doesn't know not to inflect the file names its given.