Understanding ZF2 Configuration

In Zend Framework 2 we no longer have the commanding application.ini, instead we got the option to configure our website or rather the modules on a per-module-basis. Furthermore, the modules are able to overwrite each others configuration. With this in mind, it makes it even more important to understand how ZF2 manages the configuration files of several modules internally. In this blog i will guide you guys through the internal process of the framework.
Read More…

Zend\Form\Element\Select and Database Values

One of the most common questions currently is how one is able to populate a Zend\Form\Element\Select with data from the database. In this blog I am going to demonstrate to you guys how you can achieve this using three different ways. First will be the very barebone way using Zend\Db\Adapter\AdapterInterface, another way will be using the Zend\Db\TableGateway\TableGatewayInterface and the third option to make this possible using a Doctrine\Common\Persistence\ObjectManager.
Read More…

ZfcUser, BjyAuthorize and Doctrine working together

Hey there, this will be the starting blog of my series for developing a full application. In this part i will cover one of the core features of basically every application there is: Authentication, Authorization and DB-Connectivity. Since with ZF2 the wheel doesn’t have to get re-invented over and over again, there already are great modules out there, that do the job. They may not be applicable 100% to even my current needs, but they can be extended. And that’s what we’ll be going to do at a later time. For now, all we’re going to do is make these modules work well together.
Read More…

Coming content for this blog

Everyone, I’m back! I wasn’t able to write a lot of post in those past three months due to personal reasons, but I’m back and I’ve brought some goodies. I have something nice planned for the coming months and I’m here to let you guys know. I have planned for teaching you guys a couple of basic stuff for ZF2-Projects, providing sources from a real application. Please read the full article if you’re interested in the detailled topics that will be posted within the next weeks.
Read More…

ZF2 Performance QuickTipp #2 – Classmap Autoloading

When it comes to any framework, the autoloading of classes is a huge concern. One of the first goals on ZF2s roadmap has been to get rid of all those require_once() statements inside the code to improve the overall performance. Taking a look at the ZendSkelettonApplication we can see inside Module.php, that the autoloading is done by several classes. The default approach most developers are using is with using Zend\Loader\StandardAutoloader. This is good and fine and serves it’s purpose, but if we take a closer look at the performance, a huge increase in speed can be achieved. In this blog i will tell you about the Zend\Loader\ClassMapAutoloader and what massive speed increase you can account with it.
Read More…

Zend Framework 2 Translate, I18n, Locale

Translanslation in ZF2 is handled pretty easily and one has several ways to do it. In this blog i will follow the ZendSkeletonApplications approach by using translation files in *.mo-format. How do we create those files? How do we tell the application to use the files? What options do we have to set the locale to use? I will answer all these questions for you to internationalize your modules.
Read More…

Create .po language files using PoEdit

In this post i will instruct you guys on how to create your very own translation files for your ZF2-Modules using PoEdit. I wasn’t able to find any information at all on how to create language files from scratch. All i was able to find were information on how to edit existing ones. If your google skills are as bad as mine, i hope you somehow found this post for me to help you out. Let’s take a look on how to create language files from scratch.
Read More…

Why ROOT_PATH is not needed

Today at StackOverflow.com i encountered a question regarding how to find out about the ROOT_PATH from within a Zend Framework 2 Controller. In ZF1 there were definitions like ROOT_PATH and APPLICATION_PATH so handling includes was pretty straight forward. This however has changed in ZF2. Usually you should not be needed to manually include anything as it should all be handled by either Dependency Injection or simply put the Autoloader. But if you do need it for some case, here’s the answer on how to do it.
Read More…

1 2  Scroll to top