Featured Post

Localizing application in Zend Framework 2

Today I would like to focus on translating application in Zend Framework 2. Overview By default, tutorial application has included Zend\I18n\Translator\Translator configuration in /module/Application/config/module.config.php as follow: PHP // ... 'translator' =>...

Read More

[PL] Recenzja książki Zend Framework 2 Cookbook

Posted by evolic | Posted in Book review, Web development | Posted on 03-05-2014

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

2

Recenzja książki Zend Framework 2 Cookbook autorstwa Josephus’a Callaars wydanej przez Wydawnictwo Packt Publishing.

Książek kucharskich jest wiele, choć poświęconych Zend Framework 2 wcześniej nie widziałem. Nazwa-nazwą, tytuł-tytułem, jednak każda książka musi się czymś wyróżniać na tle innych. Inaczej będzie po prostu jedną z wielu książek kucharskich… a tych jest jak na lekarstwo.

Okładka książki: Zend Framework 2 Cookbook

Co prawda książek poświęconych Zend Framework 2 jest wciąż niewiele, także jest o co walczyć.

Książka kucharska zawiera zwykle wiele przepisów, opatrzonych ładnymi zdjęciami i wskazówkami jak konkretne danie wykonać samodzielnie. Uczy więc przez ćwiczenie i powtarzanie, aż dojdziemy do perfekcji.

W końcu dobrym kucharzem-programistą nie staniemy się w 24 godziny, jak często przekonują nas książki poświęcone technologiom informatycznym!

Czy autor tej książki stanął na wysokości zadania?

Postaram się odpowiedzieć na to pytanie w niniejszej recenzji.

Unit testing in Zend Framework 2

Posted by Tomasz Kuter | Posted in Programming, Web development | Posted on 07-04-2013

Tags: , , , , , , , , ,

3

Overview

Today I would like to focus on the unit testing in applications made with Zend Framework 2 and Doctrine 2 ORM. Sample unit tests were included with Zend Framework 1.x and they are also attached to Zend Framework 2 Tutorial.

Important is, that we have two approaches of testing controllers for the latest version of the framework:

  • first, based on class PHPUnit_Framework_TestCase,
  • and the second, which uses AbstractHttpControllerTestCase class.

Creating one to many relation in Doctrine 2 ORM

Posted by Tomasz Kuter | Posted in Programming, Web development | Posted on 23-03-2013

Tags: , , , , , , ,

0

Introduction

In this tutorial I will present relational mapping between albums and songs.
In Zend Framework 2 Tutorial we had only one table – it was called albums, and stored albums data.

Today we will extend our sample application with new table – songs.
Each album can has many songs, but single song can be connected to only one album.
It is called relation OneToMany in Doctrine ORM.

Update your database with following:

Writing DQL statements

Posted by Tomasz Kuter | Posted in Programming, Web development | Posted on 21-03-2013

Tags: , , , , , , , , , ,

0

Today I would like to focus on something, what Doctrine 1.x users know, but it looks a little bit different – Doctrine Query Language (DQL) statements.

In the last tutorial we had had working Album Controller, which was using Doctrine Entity Manager, to get the Album data. Now we will focus on something more advanced – writing SQL alike statements to get some data from the album’s table.

So lets begin…

Integrating Zend Framework 2.x with Doctrine 2.x ORM

Posted by Tomasz Kuter | Posted in Programming, Web development | Posted on 02-03-2013

Tags: , , , , , , ,

0

Today I would like to present Doctrine 2 ORM integration with Zend Framework 2.
I had some problems with this, so I would like to share the solution for my issues.

Downloading sample project

First of all you need to download example ZF2 project. We have two example projects created by Zend Framework team:

I propose to download first one.
If you downloaded ZIP archive from the GitHub repository, just go to extracted project directory and run command line from that location.

Downloading vendor libraries

Now try to download latest Zend Framework by typing in command line:

You shouldn’t experience any problems in that.

You can get a message from composer, that it is not up to date:

You can upgrade it by typing the command:

Downloading Doctrine 2 ORM

Now we should modify the composer configuration file to be able download latest Doctrine 2 ORM.