Actually, what is a framework? Type cakePHP? How are frameworks made? Is it just a set of helper classes and functions or something else? Or a new language based on php?

    1 answer 1

    • In essence, the framework is a set of auxiliary classes and solutions for any sample tasks. From the famous examples - CakePHP , CodeIgniter , Symfony , Kohana .

    • Frameworks are usually born when a developer or development team makes it possible to do the same tasks anew, and they understand that some common approaches can be used to solve these similar tasks. These "approaches" are just taken out in the framework.

    In some cases, frameworks inside themselves implement the so-called DSL - domain-specific language , that is, some new simple programming language designed to solve highly specialized tasks. In this case, this language is interpreted (in the case of PHP frameworks), of course, using internal PHP tools.

    • Well, CakePHP is not just a set of classes, but also DSL. And how is DSL implemented? Any changes in the interpreter? - iproger
    • one
      @mctrane Well, in the case of web development, each such framework is now fashionable to release with a template engine on board, which is DSL. Naturally, I did not study the source code of CakePHP , but I am ready to assume that there is some core of the framework itself, and, accordingly, there is some part of this core that interprets and performs lexical parsing of the template code. And then, once the analysis is done, everything else is simple and you can already give ready-made pages. - Costantino Rupert
    • one
      @mctrane Of course, in real frameworks everything is much more complicated, but I think that I painted the big picture correctly. For such an implementation, the changes in php itself are not required, although, theoretically, any functionality of such a plan can be made into separate plug-in modules of the interpreter. The benefit of php not monolithic. - Costantino Rupert
    • Is it possible to take for the framework, several functions of working with forms? - iproger
    • @mctrane Well, that's forgive, terminology questions. It is possible to call the framework and one class without functions, and then walk and talk - well, they say, I wrote 1000 different frameworks. - Costantino Rupert