Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Tomas Votruba:
How we Migrated from Nette to Symfony in 3 Weeks - Part 1
Feb 25, 2019 @ 15:58:27

Tomas Votruba has a post to his site sharing some background on a migration he recently helped perform migrating an application from Nette to Symfony.

On the break of January/February 2019, we migrated whole Entrydo project from Nette to Symfony. It was API backend with no templates, but still, it wasn't as easy as I expected.

Many coffees and beers were drunk during this migration. 0 programmers were too frustrated to give up. Yet, you'd laugh if you knew what took us the most time.

He starts with some of the reasoning why they wanted to make the move and walks through the steps they took to get there:

  • getting ready
  • making a commitment
  • automated migrations > manual changes

He also talks about some "WTF moments" they had along the way where code that should have worked wasn't (and the simple issue that caused them).

tagged: migration nette symfony process background api

Link: https://www.tomasvotruba.cz/blog/2019/02/21/how-we-migrated-from-nette-to-symfony-in-3-weeks-part-1/

Tomas Votruba:
How to Slowly Turn your Symfony Project to Legacy with Action Injection
Apr 24, 2018 @ 14:55:49

Tomas Votruba has a new post to his site showing how to "turn your Symfony project to legacy" through the use of action injection for mapping controllers and methods to request handling.

The other day I saw the question on Reddit about Symfony's controller action dependency injection. More people around me are hyped about this new feature in Symfony 3.3 that allows to autowire services via action argument typehints. It's new, it's cool and no one has a bad experience with it. The ideal candidate for any code you write today.

Since Nette and Laravel introduced a similar feature in 2014, there are empirical data that we learn from.

Today I'll share the experience I have from consulting few Nette applications with dangerous overuse of this pattern and how this one thing turned the code to complete mess.

He starts off with some example code, asking where the issue is showing a call to a service handler to process the an argument. This would be used when a controller is registered as a service to help reduce the amount of work to define routes and add more "magic" for request handling. While the idea sounds good, he points out some of the issues with the approach including dependency injection problems and how, if it expands outside of controllers, it can lead to a poorly written application.

tagged: symfony injection action legacy nette dependency issue

Link: https://www.tomasvotruba.cz/blog/2018/04/23/how-to-slowly-turn-your-symfony-project-to-legacy-with-action-injection/

Auth0 Blog:
Building an app with Nette and adding authentication
Sep 21, 2017 @ 15:07:59

On the Auth0 blog there's a tutorial posted that shows you how to build an application with the Nette framework and easily integrate authentication via their own JSON web token functionality.

Nette is a free, open-source PHP framework designed for building web applications. Nette is a set of decoupled and reusable PHP packages that will make your work easier. And Nette is also known as the quick and comfortable web development framework in PHP because it has the tools that allow you to bang out PHP applications rather quickly.

[...] In this tutorial, I'll show you how easy it is to build a web application with Nette and add authentication to it. Check out the repo to get the code.

The tutorial starts by talking about some of the built-in tools the framework includes and some basic use of each. It then gets into building the application, creating the controller, view and template to output a list of characters from Game of Thrones. From there it moves into the authentication piece, showing the integration of the Auth0 plugin and how to hook it into an application on their platform. There's a bit of configuration to set it up as an authenticator but then the framework and the plugin take care of the rest.

tagged: nette framework authentication tutorial auth0 jsonwebtoken json jwt

Link: https://auth0.com/blog/building-an-app-with-Nette-and-adding-authentication/

Omniceps.com:
Introduction to Latte | Best PHP templating engine
Aug 17, 2017 @ 16:30:15

On the Omniceps site there's a new post introducing you to Latte, the templating component of the Nette framework that can be used independently.

A PHP templating engine is the one which gives you ability to write html for your clients efficiently using PHP variables.

However, PHP was originally built to be a templating engine, but yet it was never used primarily as a templating engine. There has been so many PHP templating engine so far in the market since PHP evolved, but none of them has made as great impression on us as Latte. Introducing you to Latte, one of the best PHP templating engine you have come across so far. Also Latte protects your web app from vulnerabilities like XSS (cross site scripting).

The tutorial starts with an example comparing "plain old PHP" templating with the Latte version for a foreach loop. Next they show how to install the Latte component and the two different kinds of macros the tool includes. They also talk about filters, performance concerns, context aware escaping and "pretty output" options.

tagged: nette framework template component latte introduction tutorial

Link: http://www.omniceps.com/latte-best-php-templating-engine/

SitePoint PHP Blog:
Nette Framework: First Impressions
Jun 23, 2015 @ 14:41:33

The SitePoint PHP blog has a new article posted with some first impressions of the Nette framework, a larger but not often talked about PHP framework that showed up in their framework survey results in third place.

SitePoint’s PHP channel conducted its annual survey on the most popular framework of 2015 and the results were discussed here. We saw some familiar names: Laravel, Symfony2, Phalcon, Silex, Slim, etc. But wait, what is this: Nette? According to the survey result, it ranked number 3 in both “at Work” and “in Personal Projects”, just tailing the two giants: Laravel and Symfony2.

I had never heard of this framework before the survey results got published. A framework so popular is worth looking into. Thus, in this article, we will take a look at Nette, see what it can do and discuss some of the features.

The Nette framework is a "set of decoupled and reusable PHP components" that combine into a complete framework (including templating, error tracing and unit testing integration). He follows along with their Getting Started guide and helps you get a demo application copy up and running (via Composer). He then goes through the project structure, the "Adminer" tool, route handling, controllers/actions and the "Latte" templating engine. He also covers basic security functionality and some other interesting features like the "Tracy" debugger and the use of the integrated unit test functionality.

tagged: nette framework first impression overview demo project tutorial

Link: http://www.sitepoint.com/nette-framework-first-impressions/

SitePoint PHP Blog:
Best PHP Framework for 2015 – SitePoint Survey Results
Mar 30, 2015 @ 16:59:00

In a new post to the SitePoint PHP blog editor Bruno Skvorc shares the results of the PHP framework survey the site posted a month back. In it they asked developers for their opinions on favorite frameworks (not necessarily the one they use, but their own personal opinion). For anyone that's been keeping up with the current state of PHP frameworks, the results aren't all that surprising though.

One month ago, we started the annual SitePoint framework popularity survey. Now that the month has expired, it’s time to look at the results and to distribute the prizes. The response was a whopping ~7800 entries, far more than any other survey we’ve held so far, and even after filtering out invalid entries we end up with a formidable number of valid participants.

According to the results the most popular framework, by far, was Laravel. Coming in second was Symfony2 and third the Nette framework. They did ask for different opinions for personal versus business choices but the results track the same between the two. He also splits out the data into the top results by country and by the age of the people who responded.

He finishes off the post with some of his own thoughts on why Laravel was the clear winner with only some of it having to do with the framework itself. He points out the related projects, "near perfect documentation" and other things (like Laravel's own subreddit). He suggests that, even though open source and "free" tend to go together, spending money and a good amount of time on a project can help ensure it succeeds. He also offers some practical advice for those wanting to give their project a boost:

Spread the word, analyze solutions from other people, discuss them. Be open, be transparent. Have an official blog, get a StackOverflow tag, justify your decisions, get in touch with popular publications which can help promote your framework if you present it well enough.
tagged: framework survey results opinion popularity 2015 laravel symfony2 nette

Link: http://www.sitepoint.com/best-php-framework-2015-sitepoint-survey-results/


Trending Topics: