下面這個圖中箭頭指的地方肯定是一個數組,而這個數組肯定在之前是sql出來的,我想找出這個sql句,不知如何查呢源碼呢?主要是關鍵字怎麼輸呢
回複討論(解決方案)
尋找 $output 變數。
在引入這個模版檔案的php頁面尋找$output
我查了一下,沒有,引入的頁面是index.php
尋找 $output 變數。
整個源碼中有幾百處引用$output,看的我頭婚眼又花啊,媽牙!這可咋整,還有別的招嗎?
查navigation這個model的類
我還是帖出index.php引入頁的源碼吧
查navigation這個model的類
不好意思,這個類有是有,但裡面是空的 它裡面有這麼一句話:
/**
* 擷取導航
*/
Tpl::output('nav_list',($nav = F('nav'))? $nav :H('nav',true,'file'));
不知從這句中查哪裡呢
用 debug_backtrace 看一下
用 debug_backtrace 看一下
試了一下,列印出這麼一大坨,這怎麼判斷呢
[code=php]
Array ( [0] => Array ( [file] => D:\WWW\cms\templates\default\layout\cms_layout.php [line] => 3 [function] => require ) [1] => Array ( [file] => D:\WWW\core\framework\libraries\tpl.php [line] => 118 [args] => Array ( [0] => D:\WWW\cms\templates\default\layout\cms_layout.php ) [function] => include_once ) [2] => Array ( [file] => D:\WWW\cms\control\index.php [line] => 20 [function] => showpage [class] => Tpl [type] => :: [args] => Array ( [0] => index ) ) [3] => Array ( [file] => D:\WWW\core\framework\core\base.php [line] => 97 [function] => indexOp [class] => indexControl [object] => indexControl Object ( [publisher_name:protected] => [publisher_id:protected] => 0 [publisher_type:protected] => 0 [attachment_path:protected] => [publish_state:protected] => 2 ) [type] => -> [args] => Array ( ) ) [4] => Array ( [file] => D:\WWW\core\framework\core\base.php [line] => 52 [function] => control [class] => Base [type] => :: [args] => Array ( ) ) [5] => Array ( [file] => D:\WWW\cms\index.php [line] => 35 [function] => run [class] => Base [type] => :: [args] => Array ( ) ) )
[/code] 我突然想到了,它會不會是一個表單,因為這個是後台輸入的,只要一輸入就進入這個數組裡面,結果一查還真是,不過還有一點疑問,那就是這個數組索引在td中啊,雖然這個td在form表單中,但是就是這樣,他也不會在表單值中啊,因為表單我理解必須在input中才行,這個怎麼解釋呢
還有一點就是:這個 $output到底在哪裡定義的,它不可能憑空就有的,肯定是在哪裡定義的
我搜了下源碼,到是有不少$output,但是都不象定義的初始模樣,很多一看就是引用的。