A few days ago, the backstage of the hot network was basically, and the time to summarize the work.
In the design mode, I tried to use the MVC mode development. Use the Smarty control to control various Actions with the CASE statement, then write the Class of various modules to the action. This is indeed a bit of control over the code, such as writing a getallmsg () function in class.Message.php, then this function can be called by many ACTION. Then match the paging class. Flexible on the processing of data.
$ db = new db;
$ SQL = "SELECT * from com_info, hr_info where hr_info.ci_id = com_info.id and {$ cate} like '% {$ content}%';
$ TOTALARR = $ DB-> EXECUTE ($ SQL);
$ URL = "hr.php? Op = SearchhrInfoAction & Cate = {$ Cate} & Content =". Urlencode ($ Content);
$ TOTALITEMS = Count ($ TOTALARR);
$ currentpagenumber = (isset ($ _ get [page '))? $ _ get [' Page ']: 1;
$ PAGENAV = New Pagenumber ($ TOTALITEMS, 3, 3, $ URL);
$ currentPagers = $ Pagenav-> GetRSperPage (& $ TOTALARR);
$ Pagenavigation = $ Pagenav-> getPagenumber ();
$ Smarty-> Assign ("PagenaVigation", $ PAGENAVIGATION;
$ Smarty-> Assign ("HR", $ CurrentPagers);
$ Smarty-> Display ("hr_get.htm");
And this way is very helpful for collaborative development, and the code repetition rate is not very high.
However, as shown in the previous code, in addition to the Class of various modules, because the existence of various personalized queries, inevitably use DB classes directly in Control (of course, these processes can be placed in Class) But a little bloated and made).
But it is convenient, if a piece of code or a function is not called by other places, you can put the MC together, and you can use it alone, this requires serious analysis of the software. Get off work, go home.