I recently started rewriting a project that I did a few years ago using CakePHP. This time I'm trying to do everything right, so maybe someone will give me a pointer to the following:
I am showing a simple table from a table using Model-> find ('all') in the view. There are two Boolean fields in this table, which together make up what I need to show the user. So: 0x0 = 'A', 1x0 = 'B', 0x1 = 'C', 1x1 = 'D'. Where should I put this logic? I thought of the following methods:
This task may seem trivial, but I think that it can teach me that this project should be organized and supported from the very beginning.
Thank!
Well, it depends on the type of logic for compiling the final table (is it a presentation or a business?).
, , . ? , View, HTML, . , , , - -, . , , (, , ).
.
, , . , afterFind .
, , . , .
, datamodelling, . !
! . (, HTML UI).
Source: https://habr.com/ru/post/1733144/More articles:Can I check the override for OnAuthorization in the base class of the ASP.NET MVC controller? - asp.net-mvcpycurl install :( there is already a version of libcurl min. - pythonЕсть ли простой способ удалить появление lexeme в tsvector? - postgresqlThe Window service cannot restart, even if the Restore option is configured - recoveryHow to enable / disable text field when pressing radio button using javascript? - javascriptCalculate tree height - c ++ServletRequestWrapper or ServletResponseWrapper in production? - javaIs the single wxWidgets MSW application binary compatible with Win2K, XP, Vista and 7? - windowsHow to pass hidden parameters to "link_to" - ruby-on-railsReplace any line before "/", PHP - phpAll Articles