What is the purpose of the $this keyword in FastAdmin?

2026-04-27 19:231阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

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

What is the purpose of the $this keyword in FastAdmin?

phpnamespace app\index\controller;

use app\common\controller\Frontend;

class Index extends Frontend{ protected $noNeedLogin='*'; protected $noNeedRight='*'; protected $layout='';

public function index() { return $this->viewFetch(); }}

<?php namespace app\index\controller; use app\common\controller\Frontend; class Index extends Frontend { protected $noNeedLogin = '*'; protected $noNeedRight = '*'; protected $layout = ''; public function index() { return $this->view->fetch(); } public function ceshi() { $this->success('成功',url('index/index/ceshi2',['abc'=>'123','de'=>'666'])); } public function ceshi2(){ $p=$this->request->param('abc'); // $ps=$this->request->post(); // $get=$this->request->header(); print_r($p); // print_r($ps); // print_r('<pre>'); // print_r($get); // print_r('</pre>'); } public function ceshi3() { $this->success('成功',url('index/index/ceshi2',['abc' =>'1', 'ceshi' =>'2222'])); } }

执行网址:localhost/index/index/ceshi

跳转网址:localhost/index/index/ceshi2/abc/123/de/666.html

返回参数:123

What is the purpose of the $this keyword in FastAdmin?

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

What is the purpose of the $this keyword in FastAdmin?

phpnamespace app\index\controller;

use app\common\controller\Frontend;

class Index extends Frontend{ protected $noNeedLogin='*'; protected $noNeedRight='*'; protected $layout='';

public function index() { return $this->viewFetch(); }}

<?php namespace app\index\controller; use app\common\controller\Frontend; class Index extends Frontend { protected $noNeedLogin = '*'; protected $noNeedRight = '*'; protected $layout = ''; public function index() { return $this->view->fetch(); } public function ceshi() { $this->success('成功',url('index/index/ceshi2',['abc'=>'123','de'=>'666'])); } public function ceshi2(){ $p=$this->request->param('abc'); // $ps=$this->request->post(); // $get=$this->request->header(); print_r($p); // print_r($ps); // print_r('<pre>'); // print_r($get); // print_r('</pre>'); } public function ceshi3() { $this->success('成功',url('index/index/ceshi2',['abc' =>'1', 'ceshi' =>'2222'])); } }

执行网址:localhost/index/index/ceshi

跳转网址:localhost/index/index/ceshi2/abc/123/de/666.html

返回参数:123

What is the purpose of the $this keyword in FastAdmin?