Problems with filtering data in MVC mode
阿神
阿神 2017-05-16 17:06:40
0
1
452

Data is a multi-dimensional array:
1. If data filtering is performed on the M (or C) layer, it is convenient for the V layer to display data, but M and V need to perform an array traversal respectively.
2. If the filtering is placed directly on the V layer, only one array traversal is needed, but it conflicts with MVC and is inconvenient for front-end processing.
How did everyone deal with it?
(In fact, this problem also exists in non-MVC mode, but it is easier to understand with MVC)

阿神
阿神

闭关修行中......

reply all(1)
習慣沉默

If display and logic are separated... then only two array traversals can be done... There is no way...

Small processing of data such as truncation, etc. can be completed at the V layer...but filtering must be completed at the M layer...

This is a matter of collaboration... It is normal to sacrifice a little efficiency...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!