0

请阅读问题的最后一行。

JviewHtml 构造函数包含以下语句

$this->paths = isset($paths) ? $paths : $this->loadPaths();

我正在使用 $path 变量设置 myview 的默认路径并将其传递给构造函数。

$paths = new SplPriorityQueue;
$paths->insert(JPATH_COMPONENT . '/views/' . $viewName . '/tmpl', 'normal');

在 net beans 调试器中,当我执行构造函数 $this->paths 的以下语句时,没有显示 $paths 变量的值。虽然两者的数据类型都是 splpriorityque

$this->paths = isset($paths) ? $paths : $this->loadPaths();

render 的第一个语句是 render()

$path = $this->getPath($this->getLayout());

$path 以 false 值返回。

我的主页显示错误“找不到布局路径”。该问题的任何解决方案

更新:最后一行路径是 splpriorityque $abc=$paths; $this->paths=克隆 $paths

在这两个语句之后 $abc 显示正确的值但 $this->paths 丢失或 loastdata.in netbeans 调试器

4

1 回答 1

1

first i decided to delete this question because of very stupid mistake. but later i decided to remain as it is.

there was some setting problem or bug in netbeans, thats why it was unable to expand $this object member "splpriorityqueue".

$this->paths = isset($paths) ? $paths : $this->loadPaths();

above statement is perfectly correct.

and the error "layout path was not found" was beacause i named my tmpl folder as templ. which was causing realpath() function in

JPath::find() 

to not work properly.

于 2013-10-08T12:35:12.543 回答