Is the CI framework superfluous?

when I first came into contact with the frame, I felt that the CI framework had a lot of superfluous places, such as:

  • the acquisition of POST parameters: $_ POST ["key"] is not it easier and more convenient than $this- > input- > post ("key") ?
  • set cookie: setcookie () and $this- > input- > set_cookie ()
  • execute sql statements: mysql_query () and $this- > db- > query ()
  • there are also activity records, how this sql is executed

where are these interfaces better than the native ones? If the function is the same, why not just use the native function instead? what are the benefits?

Mar.18,2021

strong in:

  1. $this- > input- > post ("key") checks for the existence of key
  2. $this- > input- > set_cookie () you can use an array as a parameter
  3. $this- > db- > query () can be adapted to a variety of databases (of course, database-specific features may not be supported), and the interface is also friendlier than mysql/mysqli
  4. Active Record is a design pattern for implementing ORM, which is characterized by its ease of use

$_ POST ["key"] is written incorrectly
is correct isset ($_ POST ["key"])? Htmlspecialchars ($_ POST ["key"]): null;

other things, I don't want to say anything else

Menu