thinkphp中一个方法调用另一个方法的变量
//实例化上传类
public function upload() {
$upload = new Upload();
$upload->maxSize = 10 * 1024 * 1024;
$upload->exts = array('jpg', 'jpeg', 'gif', 'txt','zip');
$upload->savePath = './';
$upload->hash = false;
$info = $upload->upload();
if (!$info) {
$this->error($upload->getError());
}
else{
foreach ($info as $file) {
$uploadFile=$file['savepath'].$file['savename'];
echo $uploadFile;
}
}
}
//添加文章
public function addArticle(){
$sort = $_POST['sort'];
$title = $_POST['title'];
$intro = $_POST['intro'];
$pic = $_POST['pic'];</