我有奇怪的问题。
Line 61: $this->_currentRoute = Default_Model_Routes::getInstance()->getCurrentRoute();
.......... other code ..........
Line 86: var_dump(isset($this->_currentRoute['url']));
Line 87: var_dump($this->_currentRoute['url']);
Line 88: if ($this->_currentRoute['url'] == $currentUrl)
Line 89: $navigation[$key]['active'] = true;
Line 90: var_dump($this->_currentRoute);
这是结果:
bool(true)
string(62) "cs/Polozka-menu-1/Polozka-menu-1-1/Polozka-menu-1-1-1/Clanek-1"
array(17) {
["url"]=>
string(62) "cs/Polozka-menu-1/Polozka-menu-1-1/Polozka-menu-1-1-1/Clanek-1"
["type"]=>
string(7) "article"
............
}
并在错误日志中:
[09-Mar-2011 19:49:32] PHP Notice: Undefined index: url in ...file... on line 87
[09-Mar-2011 19:49:32] PHP Notice: Undefined index: url in ...file... on line 88
请,如果您有任何想法可能出现问题或如何解决,请告诉我。谢谢 :)
我尝试了另一个测试:
$test = array();
echo $test['lol'];
有了这个结果:
Notice: Undefined index: lol in ...file... on line 92
有些人认为真的很有趣:这个'lol'错误显示在输出中,但'url'错误不是!它只在日志中......为什么????? 它是同一个文件,在“url”下的行 var_dump() ... 疯了