To make changes to ZenTao, you must know where the target code is located. After understanding the directory structure of ZenTao, let's see how to find the target code to be changed.
1. Positioning of the "control" method
"control" method is the entrance of each page. Let's take bug-browse-1.html and /?m=bug&f=browse&productID=1&t=html as examples.
- bug-browse-1.html: It means that it's the browse method of accessing the bug module, the first parameter passed is 1, and the page type accessed is html.
- /?m=bug&f=browse&productID=1&t=html: "m" indicates the module name, "f" indicates the method name, and the rest indicates the parameter list.
So, we could find the source code of ZenTao, module/bug/control.php in the browse method:
2. Calls in the control method
OK, now that we know where the entry function is, let's take a look inside.
$this->bug indicates calling the model object of the bug module, so, where is its corresponding files? Yes, it's in module/bug/model.php!
this->loadmodel('tree')->xxx indicates loading the model object of the tree module, and its corresponding file is in module/tree/model.php.
$this->app->loadClass('pager') indicates loading a lid class, and its corresponding file is in lib/pager/pager.class.php.
$this->lang->bug->xxx, which is defined in module/bug/lang/zh-cn.php. "zh-cn" at the end depends on the language of the current user.
Now let's have a look to the module files. After $this->display(), the template file under the view directory with the same name as the current method is called. For example, for bug's browse method, its corresponding template file is module/bug/view/browse.html.php