Nette Pro – Magazine 10/2017

by Honza Černý 21 days ago in Nette

Speed ​​up your websites

As you know, Nette Framework has excellent support for easy AJAX websites. So it's a shame that lots of sites built on Nette does not use this opportunity to speed up the web. The library of Vojta Dobeše nette.ajax.js which is currently a little bit old. Another help recently came up the Nittro, which grew up to version 2. Recently we have the Naja library.

Is it possible to try Nette Database without the whole framework, but with the beauty of DI and Tracy? Yes. New example in git repository

Jáchym Toušek (enumag) introduced an extensive package of Arachne libraries that brings some insights from the Symfony world or an alternative view of core Nette components.

In a Nutshell

Contribute – utils – an interesting widget, that can be used by several developers contributte/utils

Nextras – ORM – beta version of upcoming 3 nextras/orm

Dibi – v 3.1.0 dg/dibi/releases/tag/v3.1.0

Milo / Crypt — Simple class for encrypt and decrypt with signature gist/6fe7…813b

David Grudl – How to mock the final classes? https://phpfashion.com/…-final-tridy

In Conclusion

Thanks to partner of edition: Gamee

If you have ideas how to improve our next edition, please let me know. Have I forgotten something? Make sure to email me and we will include it in the next edition. We are still looking for partners who wish to address the growing community interested in our news.

Honza Cerny


Nette Pro – Magazine 9/2017

by Honza Černý 2 months ago in Nette

Support for PHP 7.2 is here!

For all who doesn't know about new type of versions of Nette Framewor 2.4, there is no planed 2.4.x version. All packages have their maintenance version, but Framework doesn’t have. There is build from (2017–08–29) with release notes, that is full compatible with incomming PHP version 7.2

We spent summer together at an extraordinary meeting Nette Camp and two excursions to Czech breweries. Definitely follow up the events next year. It's an interesting way to meet in an offline world. In September, the 90th anniversary Last Saturday is waiting for us.

In a Nutshell

Contribute — Minimalistic integration of Symfony/Console to Nette application contributte/console

Nextras — datagrid v 3.0.0rc nextras/datagrid/releases/tag/v3.0.0-rc2

Nextras — migration v3.0.5 & v3.1rc nextras/migrations/releases/tag/v3.0.5

PeckaDesign — asynchronous components github.com/peckadesign/AsyncControl

Nas — a component for nested selectbox NasExt/DependentSelectBox

In Conclusion

Thanks to partner of edition: www.tajnyprojekt.cz

If you have ideas how to improve our next edition, please let me know. Have I forgotten something? Make sure to email me and we will include it in the next edition. We are still looking for partners who wish to address the growing community interested in our news.

Honza Cerny


PhpStorm and code completion for $this->template

by David Grudl 3 months ago in Nette

How to get rid of PhpStorm alerts on “undefined fields” and activate the code completion for $this->template in presenters?

So how to change this view with the underlined abc and the empty pop-up window:

Into this?

Simply. Just add the following annotation to the presenter (for example to BasePresenter):

/**
 * @property-read \Nette\Bridges\ApplicationLatte\Template|\stdClass $template
 */
abstract class BasePresenter extends Nette\Application\UI\Presenter

Note: In the latest versions of Nette, this annotation will be directly in the code.

Template class

The stdClass class in the annotation is a workaround for PhpStorm, which otherwise treats all variables as undefined. However, it is more interesting to create a class with a real list of the variables that the template uses, including their types. It may look like this:

class ArticleTemplate
{
    /** @var string */
    public $lang;

    /** @var int */
    public $page;

    /** @var string[] */
    public $menu;

    /** @var Model\Page */
    public $article;
}

And then put it in the annotation of a specific presenter instead of stdClass:

/**
 * @property-read ArticleTemplate|\Nette\Bridges\ApplicationLatte\Template $template
 */
final class ArticlePresenter extends Nette\Application\UI\Presenter

From now on, the message is perfect:

We still have to solve the suggestion in the template. So far, Latte plugin can't do it, but once it can, it could use the same template class. For example, there could be a new macro {template App\Presenters\ArticleTemplate} that will pass the template class name.


Nette Pro / Magazine #4

by Honza Černý 12 months ago in Nette

New Nette 2.4 is out

After a summer break, here comes a whole heap of news and info about what has been going on and what is in the picture. The hottest piece of news is the new version of Nette Framework 2.4. A complex overview of changes made to the framework, including all novelties related to versioning, can be found on the release webpage: https://forum.nette.org/…2-4-released. In short, in the future only respective packages will be versioned (such as the release described here: https://forum.nette.org/…4-2016-07-31). Other big changes that should be mentioned is Nette/Object replacement with traits, see David's talk from Hradec Králové: https://www.youtube.com/watch?… and the fact the “guts” of Latte, a template system, have been rewritten (a video from Plzeň will be published on YouTube soon). Here is also a post bringing attention to what you need to be careful about when migrating: https://forum.nette.org/…nette-2-4-rc. If you're still unsure whether you should use the latest version of Nette Framework or not, why don't you read a short post from the Slevomat boys about changin to 2.4: https://twitter.com/…122388672512, there are more and more companies following the example. In case you run on 2.4 too, tweet with hashtag #nettefw.

Nette Camp

A four-day event filled with Nette and beer took place in a quaint village in Czech Paradise and judging from the reactions, it was a hit. Speaking on behalf of organisers, we have learnt yet a lot and let's hope it will be for the benefit of future events. You can expect Nette Camp 2017 again in the last two weeks of August. As a surprise we migrated addons.nette.org to a new portal: https://componette.com .

pehapkari.cz

Following several meetings with Tomáš Votruba, the Czech Symfony community care-taker, we put our heads together and we are starting to build a framework non specific php community. More news to be expected on twitter @pehapkari. Follow us for what's hot in the czech php world.

In a Nutshell

Nextras & Kdyby

Compatible extensions releases go hand in hand with the release of new Nette Framework version. Most packages are compatible with Nette 2.4 already, if sometimes in @dev versions for now. We are still waiting for some stable releases.

Profiler

Petr Knap from Netpromotion released a simple PHP profiler with a Tracy extension: https://github.com/…ion/profiler

Nette and Webpack

Jirka Pudil wrote an article on how to interlink these two platforms in an easy way: https://jiripudil.cz/…with-webpack

In Conclusion

If you have ideas how to improve our next edition, please let me know. Have I forgotten something? Make sure to email me and we will include it in the next edition. We are still looking for partners who wish to address the growing community interested in our news.

Honza Cerny

P.S.: David released a new framework version ready to support php 7.1 while I was writing my intro: https://forum.nette.org/…4-2016-09-30


Nette Pro / Magazine #2

by Honza Černý about a year ago in Nette

Nette 2.4 is coming closer

At the last PoSobota meetup, David Grudl introduced the news waiting for us in the version 2.4 which should become the LTS in Nette version 2. There are big plans with Nette version 3, especially regarding PHP 7, therefore the version 2.4 should most likely be the version for all Nette 2.x projects to stick to for good, thus the prolonged support. As of today, the minimal support of each .x version is 2 years, prolonged by at least a year in the LTS version.

Nette Camp

Summer is coming! (pun intended) and the planned outing in the open is coming with it. You can pre-register at www.nettecamp.cz. Together with Tomas Jacik, we are preparing many new things and we will try to overcome the obstacles exposed by last year’s 0th Camp. The date is 25 – 28 August 2016 and we are moving the venue to Český ráj.

Briefly…

Nittro

Dan Kadera is actively working on Nittro, a JavaScript framework for Nette Framework. Among new components, there is: Paginator, AutoConfirm or Dropzone. Make sure to follow @nittrojs for upcoming demos. https://www.nittro.org/

VS Code

If you are coding in VS Code, you will surely be pleased with syntax support for Latte and NEON. https://marketplace.visualstudio.com/items?…

Viktor

A new version of the utility Viktor https://github.com/nella/victor was released. The utility checks whether you have the latest version of libraries installed with composer.

Worth reading…

Martin Zlamal published an article about replacing RobotLoader with PSR-4 in a new Nette application. http://zlml.cz/…der-aplikace

And not only that. He also wrote an article describing how the “magical” mapping of presenters works. http://zlml.cz/…g-presenteru

To Conclude

If you desire to leave some feedback or whether you miss some important info here, please contact me.

Honza Černý (it’s like John Black) hello@honzacerny.com


Thanks to Rockaway