如何使用tp3框架查询当前访问的控制器名称?

更新于
2026-09-24 19:12:54
0阅读来源:SEO问题
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计90个文字,预计阅读时间需要1分钟。

如何使用tp3框架查询当前访问的控制器名称?

plaintextgistfile1.txt**** 获取当前Action名称** @access protected** protected function getActionName() {** if (empty($this->name)) {** // 获取Action名称** $offset=strrpos(get_class($this), '\\', -10);** // 从尾部第10个位置开始查找** $this->name=substr(get_class($this), $offset + 1);** }** }**

gistfile1.txt

/** * 获取当前Action名称 * @access protected */ protected function getActionName() { if(empty($this->name)) { // 获取Action名称 $offset=strrpos(get_class($this), '\\', -10); // 从尾部第 10 个位置开始查找 $this->name = substr(get_class($this),$offset+1,-10); } return $this->name; }

如何使用tp3框架查询当前访问的控制器名称?

本文共计90个文字,预计阅读时间需要1分钟。

如何使用tp3框架查询当前访问的控制器名称?

plaintextgistfile1.txt**** 获取当前Action名称** @access protected** protected function getActionName() {** if (empty($this->name)) {** // 获取Action名称** $offset=strrpos(get_class($this), '\\', -10);** // 从尾部第10个位置开始查找** $this->name=substr(get_class($this), $offset + 1);** }** }**

gistfile1.txt

/** * 获取当前Action名称 * @access protected */ protected function getActionName() { if(empty($this->name)) { // 获取Action名称 $offset=strrpos(get_class($this), '\\', -10); // 从尾部第 10 个位置开始查找 $this->name = substr(get_class($this),$offset+1,-10); } return $this->name; }

如何使用tp3框架查询当前访问的控制器名称?