课程中3分40秒中,老师讲到
/**
* 获取输出数据
* @access public
* @return mixed
*/
public function getContent()
{
if (null == $this->content) {
$content = $this->output($this->data);
if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([
$content,
'__toString',
])
) {
throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content)));
}
$this->content = (string) $content;
}
return $this->content;
}
说这里的$content = this−>output(this->output(this−>output(this->data); 可以直接写成 $content = KaTeX parse error: Expected 'EOF', got '这' at position 13: this->data; 这̲样真的可以吗?如果是ajax调…this->output()会调用Json对象中的方法吧数据json_encode下,所以我觉得这里不能这样改变吧?