Jeśli jesteś właścicielem tej strony, możesz wyłączyć reklamę poniżej zmieniając pakiet na PRO lub VIP w panelu naszego hostingu już od 4zł!

Archive for Lipiec, 2017

TutsPlus.com: Understand the Basics of Laravel Middleware

TutsPlus.com: Understand the Basics of Laravel Middleware

On the TutsPlus.com site there’s a tutorial recently posted sharing the basics of middleware in Laravel applications – reusable pieces of code that operate on the request and response during the execution of your code.

In this article, we’ll dive deep into the Laravel framework to understand the concept of middleware. The first half of the article begins with an introduction to middleware and what it’s actually used for.

As we move on, we’ll cover how to create custom middleware in a Laravel application. After creation of your custom middleware, we’ll explore the options available to register it with Laravel so that it could be actually invoked during the request processing flow.

The tutorial starts by explaining what middleware is and how it functions in the flow of the Laravel application (as well as possible uses). It then starts in on the creation of custom middleware designed to redirect mobile users to the "mobile site" for the service. With the test for that in place the post then shows how to apply the middleware to the application on a route.

Source: http://www.phpdeveloper.org/news/25423

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Master Zend Framework: How to Create a Zend Expressive Module

Master Zend Framework: How to Create a Zend Expressive Module

On the Master Zend Framework site Matthew Setter has written up a tutorial showing you how to create a Zend Expressive module to help organize your application and keep related files all in one place.

I’ve been reflecting recently on the things that I commonly have to do when I begin building Zend Expressive applications. Of the list that I created, I found that one of the most common — and uninteresting — of them is setting up the rendering of static page content. [...] To solve this, I’ve usually manually created modules to handle the rendering of static page content. These module’s usually had little more than a PageAction class that returned an HtmlResponse object, whose body was a rendered template file.

[...] If you’re in a similar position to where I was and want to collate the logic into a reusable module, then follow along with me in this tutorial I’m going to step you through how to create a module which you can reuse across any Zend Expressive project.

He starts by briefly describing a "module" in the context of a Zend Expressive application and how they relate (or don’t) to the modules in Zend Framework v2. He then starts in on the module creation, showing how to set up the environment, change the Composer configuration to autoload correctly and describes what the end result should look like. From there the tutorial starts on the code required for the classes covering the basics of the class, exception handling, configuration and the creation of a factory to make a module instance.

Source: http://www.phpdeveloper.org/news/25422

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Master Zend Framework: How to Create a Zend Expressive Module

Master Zend Framework: How to Create a Zend Expressive Module

On the Master Zend Framework site Matthew Setter has written up a tutorial showing you how to create a Zend Expressive module to help organize your application and keep related files all in one place.

I’ve been reflecting recently on the things that I commonly have to do when I begin building Zend Expressive applications. Of the list that I created, I found that one of the most common — and uninteresting — of them is setting up the rendering of static page content. [...] To solve this, I’ve usually manually created modules to handle the rendering of static page content. These module’s usually had little more than a PageAction class that returned an HtmlResponse object, whose body was a rendered template file.

[...] If you’re in a similar position to where I was and want to collate the logic into a reusable module, then follow along with me in this tutorial I’m going to step you through how to create a module which you can reuse across any Zend Expressive project.

He starts by briefly describing a "module" in the context of a Zend Expressive application and how they relate (or don’t) to the modules in Zend Framework v2. He then starts in on the module creation, showing how to set up the environment, change the Composer configuration to autoload correctly and describes what the end result should look like. From there the tutorial starts on the code required for the classes covering the basics of the class, exception handling, configuration and the creation of a factory to make a module instance.

Source: http://www.phpdeveloper.org/news/25422

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

BitExpert Blog: Why using code as DI config is a win!

BitExpert Blog: Why using code as DI config is a win!

In a post to the bitExpert.de site Stephan Hochdörfer explains why he thinks that using code over configuration in a DI container is a better approach than static configuration definitions.

In my recent talk on introducing Disco – the DI container with the damn coolest name(tm) – I talk about why I believe that using XML or any other non-code configuration (YAML, JSON, …) is not a good idea. This stirred some twitter discussion recently which led to this blog post.

Just for the record, for a very long time I was part of the XML camp – just browse my collection of old talks to see for yourself. I praised XML a lot as being the only true DI configuration format.

He then goes through some of the main issues he sees with using something like XML for the dependency container’s configuration:

  • An XML editor won’t give you code-completion for PHP classes or methods.
  • Refactoring won’t work properly in an XML configuration file.
  • An XML editor is not capable of doing proper type checks.
  • XML is just too verbose.

For each item he provides a brief explanation and an example of XML where it helps to illustrate the point.

Source: http://www.phpdeveloper.org/news/25421

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

BitExpert Blog: Why using code as DI config is a win!

BitExpert Blog: Why using code as DI config is a win!

In a post to the bitExpert.de site Stephan Hochdörfer explains why he thinks that using code over configuration in a DI container is a better approach than static configuration definitions.

In my recent talk on introducing Disco – the DI container with the damn coolest name(tm) – I talk about why I believe that using XML or any other non-code configuration (YAML, JSON, …) is not a good idea. This stirred some twitter discussion recently which led to this blog post.

Just for the record, for a very long time I was part of the XML camp – just browse my collection of old talks to see for yourself. I praised XML a lot as being the only true DI configuration format.

He then goes through some of the main issues he sees with using something like XML for the dependency container’s configuration:

  • An XML editor won’t give you code-completion for PHP classes or methods.
  • Refactoring won’t work properly in an XML configuration file.
  • An XML editor is not capable of doing proper type checks.
  • XML is just too verbose.

For each item he provides a brief explanation and an example of XML where it helps to illustrate the point.

Source: http://www.phpdeveloper.org/news/25421

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Laravel News: Introducing Laravel Horizon

Laravel News: Introducing Laravel Horizon

On the Laravel News site today they have a post announcing a new member of the Laravel family that was announced at the current Laracon conference: Laravel Horizon.

The moment everyone in the Laravel community has been waiting for has finally arrived! Laravel Horizon is software to “supercharge your queues with a beautiful dashboard and code-driven configuration.”

[...] Laravel Horizon is designed to make it easy monitor your queues from a web interface and receive notifications when things go wrong.

They list out some of the key features including auto-balancing, code-driven configuration, queue monitoring and a notification system. They briefly describe each of these features and what they see as the "most awesome part" – that the entire thing is open source and 100% free.

Source: http://www.phpdeveloper.org/news/25420

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Laravel News: Introducing Laravel Horizon

Laravel News: Introducing Laravel Horizon

On the Laravel News site today they have a post announcing a new member of the Laravel family that was announced at the current Laracon conference: Laravel Horizon.

The moment everyone in the Laravel community has been waiting for has finally arrived! Laravel Horizon is software to “supercharge your queues with a beautiful dashboard and code-driven configuration.”

[...] Laravel Horizon is designed to make it easy monitor your queues from a web interface and receive notifications when things go wrong.

They list out some of the key features including auto-balancing, code-driven configuration, queue monitoring and a notification system. They briefly describe each of these features and what they see as the "most awesome part" – that the entire thing is open source and 100% free.

Source: http://www.phpdeveloper.org/news/25420

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Community News: Recent posts from PHP Quickfix (07.26.2017)

Community News: Recent posts from PHP Quickfix (07.26.2017)

Recent posts from the PHP Quickfix site:

Source: http://www.phpdeveloper.org/news/25419

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Community News: Recent posts from PHP Quickfix (07.26.2017)

Community News: Recent posts from PHP Quickfix (07.26.2017)

Recent posts from the PHP Quickfix site:

Source: http://www.phpdeveloper.org/news/25419

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Community News: Recent posts from PHP Quickfix (07.26.2017)

Community News: Recent posts from PHP Quickfix (07.26.2017)

Recent posts from the PHP Quickfix site:

Source: http://www.phpdeveloper.org/news/25419

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>