Magento Development Company, PSD to Magento, Magento Customization
Magento 2 Seminar - Anton Kril - Magento 2 Summary
-
Upload
yireo -
Category
Technology
-
view
667 -
download
2
Transcript of Magento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Summary
Me
Anton KrilMagento 2 Lead Architect@[email protected]
Communication & Documentation
☞ github.com/magento/magento2
☞ devdocs.magento.com
☞ community.magento.com
☞ alankent.me
$ composer install
Console Application$ bin/magento setup:upgrade
Configuration
☞ Configuration file per sub-system (events.xml, cache.xml)
☞ All xml validated
☞ 3 Stages of configuration loading:
➀ primary (app/etc/*)
➁ global (<ModuleDir>/etc/*)
➂ area (<ModuleDir>/etc/<areaCode>/*)
Dependency Injection
class MyClass{ public function __construct(Magento\Framework\Event\Manager $eventManager) { $this->eventManager = $eventManager; }
public function someFunc() { // … $this->eventManager->dispatch(‘some_event’); // … }}
Interception
Ability to observe public method calls:
class eventManagerPlugin{ public function beforeDispatch(EventManager $subject, $eventName, $arguments) { $this->log->put(“Event ‘$eventName’ was dispatched“); }}
Service Contracts
Public API of a module:
namespace Magento\Customer\Api;
interface AccountManagementInterface{ public function createAccount(CustomerInterface $customer, $password = null);
public function activate($email, $confirmationKey);
public function changePassword($email, $currentPassword, $newPassword);}
WebAPI
Easy WebAPI creation (REST & SOAP)
<routes> <route url="/V1/customerGroups/:id" method="GET"> <service class="Magento\Customer\Api\GroupRepositoryInterface" method="getById"/> <resources> <resource ref="Magento_Customer::group"/> </resources> </route></routes>
Themes
☞ More granular templates
☞ View file fallback
☞ LESS imports
UI Library
RequireJS Loader
define( [ 'Magento_Checkout/js/model/address-converter' ], function(addressConverter) { "use strict"; return function(addressData) { return addressConverter.formAddressDataToQuoteAddress(addressData); }; });
JS Mixins
var config = { mixins: { ‘Magento_Checkout/js/model/address-converter’: { ‘My_Module/js/model/address-converter-mixin’: true } }};
UI Components
☞ JS & CSS & HTML
☞ New forms & grids in admin and storefront
PageCache
☞ built-in cache in CE
☞ Varnish support in CE
☞ Private content rendered in browser
Asynchronous processing
☞ delayed execution
☞ ee-only