thinkphp method within the same template calls another method

WBOY
Release: 2016-08-08 09:24:58
Original
1463 people have browsed it

//Method call in the same template in thinkphp

public function a(&$txt){

$txt.='hh';

}

public function b(){

$b='bbb';

$this->a($b);

echo $b;//'bbbhh'

}

&$: Address call

public function c(){

$a='hh';

return $a;

}

public function d(){

$d = $this->c();//Call with return value

echo $ d;//'hh'

}


The above introduces how a method in the same template of thinkphp calls another method, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!