public function _before_testAction(){
echo "_before<hr>";
}
public function testAction(){
echo 'This is test func.';
}
在这里,_before_testAction 和 _before_testaction都可以起效,而且不能同时定义,因为php的函数名是大小写不敏感的!
PHP大小写 不敏感 的包括:
- 函数名、方法名、类名(推荐用驼峰式)
- 魔术常量LINE、 FILE、DIR等等 (推荐全部大写)
- NULL、TRUE、FALSE
- 类型强制转换:(int)、(bool)、(array)
网友评论