Archive of month: July 2017

Magento 2 Object Manager: Virtual Types

Last time we discussed the argument replacement feature of Magento 2’s object manager, and introduced the <type/> tag in di.xml. This week we’re going to talk about another feature related to argument replacement — Virtual Types. Virtual types allow a module developer (you!) to create “configuration only classes” for the object manager’s argument replacement feature. If that didn’t make sense, […]

Magento 2 Object Manager: Argument Replacement

In the last article of our series, we covered the “class preference” feature of Magento’s object manager. This week we’ll cover a similar, but more selective, class replacement system built into Magento 2. While this article should be accesible as a stand-alone tutorial for programmers familiar with modern object oriented concepts, if you’re having trouble try starting at the […]

Magento 2 Object Manager: Preferences

Today we’re going to explore the “class preference” feature of Magento 2’s object-manager/dependency-injection system. While this feature is a direct descendant of Magento 1’s class rewrite system, it ends up playing a different role in Magento 2. Where Magento 1’s class rewrites were aimed at allowing third party developers to customize system behavior, the class […]

Magento 2’s Automatic Dependency Injection

This week’s article is the second in a series discussing Magento 2’s object system. Last time we covered the basics of Magento’s object manager. This week we’re going explain why you’ll rarely use Magento’s object manager, as well as Magento’s implementation of the popular “dependency injection” pattern. (hint — they’re related) Many popular PHP frameworks implement a dependency […]

Magento 2 Object Manager

Magento 2 brings a slew of changes to the table for an experienced Magento 1 programmer. While you can still see bits and pieces of Magento 1 (EAV, areas, blocks, etc.), the new Magento 2 core team has spent the last few years swapping out the startup fueled internals of Magento 1 with a more mature, […]

Magento Mode

Magento has 3 modes when running. To show the current mode, we can use this command: $ php bin/magento deploy:mode:show After running this command, we will se the current mode that we are using:   You can run Magento in any of the following modes: default Enables you to deploy the Magento application on a single […]

Part 5: Adminhtml

This is part 5 of my ‘Magento 2 Module From Scratch’ series. I’d recommend you catch up with the rest first. Today I’m covering the admin area section of our module. In here, we add links to the main menu, create our grid using the UI Components in Magento 2, create mass actions, and the ability to […]

Part 4: Frontend Controllers, Blocks and Templates

So far in the series we have created our model, resource model and database schema. It’s finally time to create something which we can see! It’s time to setup our controller, blocks, layout and templates! Let’s start with our controller! You may have already read my blog post on creating a controller in Magento 2, so […]

Part 3: Setup classes & databases Skip to end of metadata

In the last part of the series we cover creating our model & resource model so that we can interact with the database. However, we haven’t yet created our table! This part of the series will soon fix that! I separated this into it’s own post as I felt it needed it’s own post! In […]

Part 2: Models & Resource Models

Today’s post is going to cover a fair bit, so grab yourself a cuppa. We’ll be covering: Models Resource Models At the end of this post you will have successfully created your first Service Contract, along with your Model, and Resource Model. A lot of this will feel familiar from Magento 1.x. So don’t worry, […]