当前位置:首页 » 快乐学习
作者:不烦恼
发布时间:February 3, 2012
分类:快乐学习
评论:0

I18N的用法:
<?php
I18n::lang('cn'); // 定义默认语言
echo __('Hello, world!'); // 用默认语言输出字符串
echo __
('Hello, world!', array(), 'fr'); // 用指定语言输出字符串 echo __
('Hello, :name!', array(':name' => 'world')); // 字符串中包含变量
i18n/cn.php中的内容例如(i18n/fr.php同理):
<?php
return array
(
'Hello, world!' => '你好世界!',
'Hello, :name!' => '你好 :name!',
);
message的用法:
<?php
Kohana::message('forms', 'name');
Kohana::message('forms', 'parent.name');
Kohana::message('forms', 'age', 'default');
messages/forms.php中的内容例如:
<?php
return array(
'name' => 'self',
'parent' => array(
'name' => 'parent'
),
);
I18N和message结合
<?php
echo __(Kohana::message('demo', 'name'), array(':name' => 'bufannao.com'), 'cn');
messaes/demo.php
<?php
return array(
'name' => 'my name is :name',
);
i18n/cn.php
<?php
return array(
'my name is :name' => '我的名字是:name',
);
PS:message主要用于validation(待续)
作者:不烦恼
发布时间:February 2, 2012
分类:快乐学习
评论:2
运行下面的代码看下效果:(埃及两足球队球迷骚乱73死 实拍冲突现场)
为embed标签设置下面的属性后就可以用布局定位将链接层放在多媒体层上面外
wmode= "transparent"
作者:不烦恼
发布时间:January 10, 2012
分类:快乐学习
评论:4
为今后补习JS而准备。
为了集成在MagikeEditor编辑器插件中,修改了插件中magike_editor.js的原代码
function createDefaultButtons()
{
// …………
// insert
addButton('RunCode', '<textarea class="runcode">', '</textarea><input type="button" value="运行" class="runbutton" onclick="runCode(this);" />');
}
运行框的JS代码
function runCode(obj){
var winname = window.open('', "_blank", '');
winname.document.open('text/html', 'replace');
winname.opener = null;
winname.document.write($(obj).prev().val());
winname.document.close();
}
运行框的CSS代码
.runcode{width:500px; height:100px; padding:8px; border:1px solid #dddddd;vertical-align:middle;}
.runbutton{width:40px; height:118px; border:1px solid #dddddd; background-color:#f4f4f4;vertical-align:middle; margin-left:-1px; color:#444;cursor:pointer;}
作者:不烦恼
发布时间:December 25, 2011
分类:快乐学习
评论:2
路由器是MP2600:
en
conf t
hostname gudingip
enable password 123
user root pasword 0 123
interface fastethernet0
ip address 60.*.*.1 255.255.255.0
ip nat outside
exit
interface fastethernet1
ip address 192.168.1.1 255.255.255.0
ip nat inside
exit
ip nat pool axmcc 60.*.*.1 60.*.*.253 netmask 255.255.255.0
ip nat inside source list 1 pool axmcc overload
ip route 0.0.0.0 0.0.0.0 60.*.*.254
ip dhcp pool axmcc
range 192.168.1.2 192.168.1.254 255.255.255.0
dns-server 8.8.8.8 8.8.4.4
default-router 192.168.1.1
#lease 360 0 0 DHCP 租期 天 [小时] [分钟]
exit
ip access-list standard 1
permit 192.168.1.0 0.0.0.255
exit
line vty 0 3
login local
exit
write
在固定IP为60.*.*.1至60.*.*.253范围内开启DHCP访问网络
作者:不烦恼
发布时间:December 21, 2011
分类:快乐学习
评论:1
<?php
function &a(&$a)
{
$a++;
return $a;
}
$a = 0;
a($a); // 引用传递
echo $a; // ????? 1
$b = &a($a); // 引用传递+引用返回
echo $b; // ?????? 2
$b = 3;
echo $a; // ?????? 3
a($a);
echo $b; // ?????? 4
?>
一直对引用理解得不好,所以写了上面的代码加深下印象
- 1
- 2
- 3
- 4
- ...
- 10
- »