Nette is an open source framework designed to create web applications in PHP. Its mission is primarily the elimination of safety risks. It supports AJAX, DRY, KISS, MVC and the code re-usability. It uses event-controlled programming and is largely based on the use of components. The original author of the framework is David Grudl, its subsequent development is supervised by Nette Foundation. Nette Framework is an open source software offered under the GNU GPL licences and Nette licence which is alternative to the original four-stroke BSD licence.

Routing

Nette Framwwork, unlike most competing frameworks, allows you to set the URL shape as the last point of preparation for the entire application. This makes it possible to process routs on both sides, which is used for parsing and generating routes.

A “nice” URL is also an essential feature in creating optimisation for browsers (SEO), as search engines evaluate these addresses and control over the URL becomes part of the site importance scoring. This affects the position in the search engine, although some experts have tried to claim that the URL does not affect the position in the search. At the same time, addresses can be easier to read, making them more memorable to page users. Nette separates the use of mood_rewrite directories, which makes it unnecessary to define a rout shape in multiple places. It helps preventing mistakes.

Error logging

In case of a production mode in which it isn’t appropriate and even desirable to use the usual error listing methods, Nette allows you to capture errors in the log. Log is a text file that records what exactly happened in the application and then corrects errors. Error logging must be turned on and the path to the directory where logs can be stored, must be set.

Two regimes of Nette

Nette can operate in two different regimes under which the server runs. Development mode is a mode that offers programmer all this information about the speed of running of the application, routing and comfortable listing of errors. Nette in the production mode hides all this information and allows error logging into a separate logging file out of the reach of the normal user.

Framework itself can detect, in which of the modes the server is. The decision is based on the IP adress of the assigned server. An error can occur by using a server running behind a proxy server or a server that is only designed for local needs of the enterprise. In case of a bad detection, the regime has to be set up manually.

The advantages of using Nette Framework

  • Strong validation language. Nette gives programmers a powerful tool to create forms. Framework itself can guard all elements of the form and even guard inputs against possible attacks, for example XSS, Cross-Site Request Forgery or UTF-8 attack
  • Automatic generation of validated JavaScript. Validation is not required to write, it is generated automatically.
  • Exact form definition. The programmer has full control over the form.
  • Automatic translation. Nette supports automatic translation.
  • Protection against SQL injections. If the notORM database is used, Nette also contains strong protection against the SQL injection.

The disadvantages of using Nette Framework

  • Manual cache deleting. From time to time, it is required to delete the cache manually.
  • Documentation. The documentation is not very comprehensive and doesn’t cover everything by far. The author partly compensates this by organising trainings. He also organise informal meetings of supporters.
  • Missing Best Practice. There are no examples of how to implement the model layer.
  • Database layer. The behaviour of the database layer varies significantly in the case of tables without the primary key.