Magento 2 Frontend Certificate From Belvg
Magento 2 Frontend Certificate From Belvg
AWARD WINNING
ECOMMERCE AGENCY
What is the purpose of each of the folders?
We will consider the web folder and its subfolders separately. Apart from
the theme root, the folder can contain the extending module. Let us
examine the table below:
Folder Folder description
/<name_Vendor>_<name_Module>/web/i 18n The folder stores localized folders for the module,
such as css/, js/ and other.
Folder example:
Magento_Customer/web/i18n/ar_SA/js/
/<theme_dir>/web/i 18n The folder stores the localized folders for the
theme, like css/, js/ and other.
Folder example:
/app/design/frontend/Magento/blank/web/i18n/a
r_SA/css/source/_extend.less
/<theme_dir>/web/c
ss The folder stores css and less files of the theme
Folder example:
/app/design/frontend/Magento/blank/web/css
/<theme_dir>/web/i mages The folder stores image files for different sprites,
theme logo, etc.
Folder example:
/app/design/frontend/Magento/luma/web/i mage
s
/<theme_dir>/web/m
age The folder contains Magento libraries files, such
as jquery, jqueryui and different cms widgets. It is
not advised to use this folder to substitute the
components. Instead, use requireJS.
How is that taken into account when creating a
custom theme or customizing an existing theme?
There can be an unlimited amount of inheritance levels in Magento 2.
Let us consider several examples of extending or overriding the child theme
files.
Templates files
The fallback scheme for templates is the following:
1. Current theme templates:
<theme_dir>/<Namespace>_<Module>/templates
2. Ancestors themes templates, recursively, until a theme with no
ancestor is reached:
<parent_theme_dir>/<Namespace>_<Module>/templates
3. Module templates: <module_dir>/view/frontend/templates
Unlike the layouts, template files can not be extended, only overridden. In
order to override the product catalog file, you need to copy:
Magento_Catalog_module_dir\view\frontend\templates\product\list.phtm
l
At the path:
app\design\frontend\vendor_name\theme_name\Magento_Catalog\templ
ates\product\list.phtml
and enter the needed modifications.
The same system applies to static files (js, css, images, fonts and .less).
The certain catalogs that the system searches for during the backup
depend on whether the module context is known for the file.
If module context is not defined for the file:
1. Current theme static files for a specific locale (the locale set for the
storefront): theme_dir/web/i18n/<locale>
The current theme is applied by default, you can change it for any of the
installed ones.
Click "save", clean the cache, and a new theme is displayed for the selected
store.
Next are the settings for head, header, footer, search robots, pagination,
watermarks for images and letters. Let’s examine them in more detail.
● Logo image. The supported file types are PNG, GIF, JPG (JPEG).
● Logo attribute width in pixels.
● Logo attribute height in pixels.
● Welcome text, which also contains the name of a logged-in user.
● Logo image alt. Alt text for the logo.
Footer settings:
Here it is written how robots should behave in terms of indexing and
returning to the site on schedule and upon editing, as well as special rules,
such as banning certain directories that should not be indexed.
Pagination settings
Here you can specify:
● The number of links to next pages
● The number of links that will be skipped. If you need to skip the list of
5 links, and the step is set to 4, then the last link of the skip will be the
first link on the new list.
● The text for the forward and back buttons, arrows are shown by
default.
Here you can set the watermark parameters for the main image sizes:
- Image (in jpeg, gif, png);
- Image opacity in %;
- Image size in pixels;
- Image position. The position of the watermark on the image.
Transactional emails
After all the options are selected, press the button in the upper right corner
to save the changes.
template="Magento_Catalog::product/list/addto/compare.phtml"/>
</block>
<block
class="Magento\Catalog\Block\Product\ProductList\Toolbar"
name="product_list_toolbar"
The highlighted elements on the picture above are the containers in which
we can insert any blocks we wish. The placement of blocks within itself is
the main distinguishing feature of the <container> element, however, it is
worth noting that, if necessary, the <block> element can also contain other
elements and even containers, and thereby it automatically becomes a
container for its child element.
Based on everything said above, one can get an impression that
<container> and <block> elements are identical to each other. However,
In the piece of code above we used xml tags <page> and <body> to
configure containers for our page, and their syntax is very similar to <html>
syntax. The same as in HTML markup, all tags must be closed (in the
example above, we used </page> and </body> closing tags) or they can be
self-closing, like <block name=”blockName”/> tag.
All elements can have special attributes for their parameters management.
For blocks and сontainers, the list of attributes and their purpose is similar:
Block and container common attributes
Attribute Value Description
name 0-9, A-Z, a-z and (-)(_)(.) A unique name for addressing
*Should begin with a letter is recorded.
after (-) element display after all in the current block Applied to position elements
or container inside the page template or
inside the container itself.
(element name) element display a fter the
element with the specified name. Has priority over b
efore
()when the parameter is absent, the element is
considered not positioned and is displayed in
the order set by the current template
after=”target_elemement”
as 0-9, A-Z, a-z and (-)(_)(.) The set name serves to
*Should begin with a letter\ identify the current element in
the parent
name=”current_allias”
Attribute values and their functional load is identical for blocks and
containers as well.
However, containers have the methods that are inherent for them solely.
Below is the table of the main attributes together with their unique values:
HtmlTag Html 5 tags (aside, main, div ...) Everything that is inside the
container will be displayed to
HtmlTag=”div” the user inside the specified
tag.
layout The name value of the page layout template It is written to indicate an
explicit indication of the
applicable template grid for
layout=”grid_name” the current layout.
*the values are not required
Let us also consider the parameters for specifying in the attributes, inherent to blocks only:
Block attributes
Attribute Value Description
class The path to the class and the class name: The path to the c
lass that is
responsible for processing
information for the current
template The path to the template and the template name Specified the path to the
template, which is
template="Vendor_Name::folder_template/name_template. responsible for rendering the
phtml" information for the current
layout block. It is applied to
specify a template for the new
element or override the
default template for the user
one.
For b
locks, the “class” attribute is required for Magento 2.1 version and earlier.
For c ontainers, the “name” attribute is required for Magento 2.1 version and earlier.
name The name of the Specified the name of the block or container to which the
display true/false Turns on or off the rendering off on the page of the
current container or block. When an element is disabled,
the further possibility of configuring it and its child
elements remains.
Nested attributes.
Magento 2 has several attributes that can be nested; their syntax is similar
to the containers and blocks declaration and looks the following way:
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/
page_layout.xsd">
<move element="category.cms" destination="page.wrapper"
after="category.view.container"/>
</layout>
xample of move instructions to override the position of the ‘category.view.container’ container
E
Move
Move is a perfect assistant for positioning elements at the page and
migrating it from a container to a container.
Let us consider the example of title block migration that displays the
current tab in the user account above the main container:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
layout=
"2columns-left"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/
before
after
Using a single command in the layout, we can easily modify the whole
pages structure without using styles and templates. The instruction
includes the following attributes:
● element - the name of the target element for passing the instruction
● destination - the name of the parent element that will perform the
moving
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/
page_layout.xsd">
<head>
<remove src="css/style-m.css"/>
</head>
</layout>
Removal of the previously connected mapping CSS file
Update
The attribute is recommended to apply in cases when you need to duplicate
one or several containers and blocks from the parent page template.
The instruction is specified in the beginning of XML template and applied
with handle attribute, in which the path and parent template filename is set.
This method has similar functionality to the super() method in the
prototype-oriented programming and performs the same functions. The
target template file will be updated recursively, or in a sequential order.
For example, you need to connect a slider with certain information to a
number of pages in your project. In this case, we need to create a template
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/
page_configuration.xsd">
<body>
<update handle="{name_of_handle_to_include}"/>
Also, the passed values can be obtained from the current template file
using get() method. This functionality perfectly corresponds to the
modularity principle in Magento. Using it, you can create a universal but
dynamic template and use it in several places in our store, just like with the
example of a universal layout with connecting a slider on pages, using the
update method inheritance.
As an example, consider the creation of a template with a button rendering
and any functionality on the client. The dynamism will lie in the fact that on
different pages we will use the same template, but depending on the
requirements, in the page template file, we can pass a css class to it, to
which some style from the stylesheet can be attached or even a functional
load implemented on js. In the markup, it will look the following way:
<block class="Magento\Framework\View\Element\Template" name="button"
template="Magento_Theme::buttons/dynamic_button.phtml" >
<arguments>
In fact, this is the simplest example of using this functionality, which is
necessary to familiarize yourself with the principle of its operation. If we
limit ourselves only to our imagination, then applying the method of
passing arguments, you can do many things, up to passing an argument
that will determine the controller for processing our template.
Arguments can be different and have different names, and you can pass
not only a string, but, as previously stated, 6 basic data types. In order to
get the attributes in the template, the function takes the following form:
2 columns with right sidebar 3 columns
Default files in the file system
This is how they look in the admin panel:
How the pages layouts are displayed in the vendor folder
The newly created layout file will recursively adapt the parent markup
during the inheritance process, yet it will change all the overridden blocks
for the ones set in the child file.
To complete the creation of the custom page layout, declare it in the layout
configuration file. In the standard Magento module, it is located at the
following path:
vendor ⇒ magento ⇒ -
module theme ⇒
view ⇒ frontend ⇒
.
layouts xml
To save it for further work with the composer, place it in the theme file:
app ⇒
design ⇒ [vendor_name] ⇒ [module_theme] ⇒
Magento_Theme ⇒ layouts
.xml
A custom grid in the admin panel
The passed id attribute for <layout> tag will be the value of a new layout.
The displayed value at the client side
Module-cms controller structure
Each template has a method that allows to get the name of the root file
template:
getLayout()
On this page, it’s default.xml, then using the method:
getUpdate()
We get the list of the layout files from which inheritance is performed
(cms_index_index and cms_page_view) with the method:
getHandles()
Layout descriptor type
Containers have their own attributes that allow you to manage it. Let us
briefly examine each of them.
What is the default block type?
Block type is defined by “class” attribute.
For example, for <block
class="Magento\Framework\View\Element\Template"
name="store_account" template="Magento_Theme::html/account.phtml"/>
block it will be class="Magento\Framework\View\Element\Template"
For instance, for
Therefore, overriding should be used very carefully and only when it can not
be done without.
● Use overriding in case you can not afford the desirable effect
through extending;
● Do not change names and aliases of blocks;
● Do not change handle inheritance.
label - it is used to label different blocks.
Example:
Let’s say you need to change the name of the link to Privacy policy in the
footer. In order to do it, you need to add the following code to layout
path - it is used to set the path for different links.
Example:
Let’s say, you want to change the path to the Privacy policy page from the
previous example. In order to do it, you need to add the following code to
layout default.xml in your theme (for example, module file Theme
app/design/frontend/BelVG/belvgtheme/Magento_Theme/layout/default.x
ml):
<referenceBlock name="privacy-policy-link">
<arguments>
<argument name="path"
xsi:type="string">privacy-policy-test-example
</argument>
If you need to customize the standard template of the module and display
it in the necessary place on the website, you should do the following:
Copy the necessary template file to the folder with the theme by relative
path.
For example, the addtocart.phtml template is on the path:
<Magento_folder>/vendor/magento/module-catalog/view/frontend/template
s/product/view/addtocart.phtml
Copy on the path:
<Magento_folder>\app\design\frontend\BelVG\<theme_name>\Magento_Catal
og\templates\product\view\addtocart.phtml
Then, in the XML file, we set the template display in the necessary place :
<referenceContainer name="product.info.main">
<block class="Magento\Catalog\Block\Product\View"
name="product.info.addtocart.second" as="addtocart-second"
This way, the block can be displayed anywhere.
Then, move it to the path:
<Magento
folder>\app\design\frontend\BelVG\<theme_name>\Magento_Catalog\templa
tes\product\view\addtocart.phtml
namespace Belvg\PaymentTrade\
Block\Form;
/**
* Class PaymentTrade
* @package Belvg\PaymentTrade\Block\Form
*/
class PaymentTrade extends \Magento\Payment\Block\Form
{
/**
* Purchase order template
*
* @var string
*/
protected $_template = 'Belvg_PaymentTrade::form/paymenttrade.phtml';
}
Here, on the tab ADVANCED -> Developer in the “Debug” section, you give
the priority “Enabled Template Path Hints for Storefront” value “Yes”.
Another way to enable the path to the template is via the console
command:
ev:t
bin/magento d emplate-hints:e
nable
public
function getSaveButtonHtml()
{
return $block->getChildHtml('save_button');
}
Or in the template:
$block->getChildHtml('save_button');
$block->getChildHtml();
<?php
/**
* Copyright (c) Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
?>
<?php if ($detailedInfoGroup =
$block->getGroupChildNames('detailed_info', 'getChildHtml')):?>
<div class="product info detailed">
<?php $layout = $block->getLayout(); ?>
<div class="product data items"
data-mage-init='{"tabs":{"openedState":"active"}}'>
<?php foreach ($detailedInfoGroup as $name):?>
<?php
$html = $layout->renderElement($name);
if (!trim($html)) {
continue;
}
$alias = $layout->getElementAlias($name);
$label = $block->getChildData($alias, 'title');
?>
<div class="data item title" data-role="collapsible"
id="tab-label-<?= /* @escapeNotVerified */ $alias ?>">
<a class="data switch" tabindex="-1"
data-toggle="trigger" href="#<?= /* @escapeNotVerified */ $alias ?>"
id="tab-label-<?= /* @escapeNotVerified */ $alias ?>-title">
<?= /* @escapeNotVerified */ $label ?>
</a>
</div>
<div class="data item content" aria-labelledby="tab-label-<?=
/* @escapeNotVerified */ $alias ?>-title" id="<?= /*
/**
* Escape string for HTML context. allowedTags will not be escaped,
except the following: script, img, embed,
* iframe, video, source, object, audio
*
* @param string|array $data
* @param array|null $allowedTags
* @return string|array
*/
public function escapeHtml($data, $allowedTags = null)
It should be your method of escaping data by default for any output. The main
point is that the output of all the methods that do not include "Html" should be
escaped.
escapeHtmlAttr()
/**
/**
* Escape URL
*
* @param string $string
* @return string
*/
public function escapeUrl($string)
This method is used for URL output. It applies HTML literal by default and
additionally deletes j avascript:, vbscript: and data:. If you want to deny URLs similar
to these among the links provided by a user, you can use the method.
All these variables are not required but using them, you will be able to
configure the deployment process according to the tasks that you need to
manage.
We also would like to remind you of clearing the static cache files before
deployment. There are two ways how this can be done:
1. In the admin panel, you should proceed to System > Tools > Cache
Management and choose F lush Static Files Cache.
2. Manually, we delete what is inside the folders “/pub/static” and
“/var/view_preprocessed/pub/static” (do not delete the folders
themselves and the .htaccess files).
}
}
<script>
We see that some scripts were loaded separately, through RequireJS and
six scripts packaged in bundle.
Here is the example of loading scripts with bundle and merging JavaScript
files functions:
return Component.extend({
defaults: {
template: 'Magento_Customer/authentication-popup'
},
});
});
In the above mentioned code we see that the standard
Magento_Customer/authentication-popup template will be used, when
creating our custom UI Component, we can specify our template through
mixin, layout, text/x-magento-init, data-mage-init.
The second way. We can specify our template in text/x-magento-init
<script type="text/x-magento-init">
{
"*": {
"Magento_Ui/js/core/app": {
"components": {
"customComponent": {
"template": "Magento_Theme/template",
"component":
"Magento_Theme/js/view/custom-component"
}
}
}
If we want to get the value of the observed object or array, we call our
function without arguments:
Name();
You can subscribe to observable objects or arrays to change the value
using the subscribe method:
1. T
o get the value before assignment you need to write the following
construction:
Name.subscribe( function
(oldValue) {
alert("Old value: " + oldValue);
},
null,
"beforeChange");
The module is created in the article on areas in Magento (Relink). We will
add the missing files to display our module in the admin panel menu and as
a separate page:
app/code/BelVG/Theme/etc/adminhtml/menu.xml —
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc
/menu.xsd">
<menu>
<add id="BelVG_Theme::belvg"
title="BelVG"
module="BelVG_Theme"
sortOrder="55"
/**
* Constructor
*
* @param \Magento\Backend\App\Action\Context $context
* @param \Magento\Framework\View\Result\PageFactory
$resultPageFactory
*/
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory
/**
* Load the page defined in
view/adminhtml/layout/belvg_index_index.xml
*
* @return \Magento\Framework\View\Result\Page
*/
public function execute()
{
$resultPage = $this->resultPageFactory->create();
$resultPage->getConfig()->getTitle()->prepend(__("Custom
Component"));
return $resultPage;
}
}
?>
app/code/BelVG/Theme/view/adminhtml/layout/belvg_index_index.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/
page_configuration.xsd">
<body>
<head>
<title>Custom Component</title>
</head>
<referenceContainer name="content">
<block class="Magento\Backend\Block\Template"
template="BelVG_Theme::index.phtml"/>
</referenceContainer>
</body>
</page>
This is the module we will need to see the UI Component binding, and now
we will create our components ourselves:
});
app/code/BelVG/Theme/view/adminhtml/web/js/component-two.js —
define([
'jquery',
'uiComponent'
], function ($, Component) {
return Component.extend({
defaults : {
title: 'Component One',
value: 'Value text'
}
});
});
Declare them in the template
app/code/BelVG/Theme/view/adminhtml/templates/index.phtml —
<div class="row">
<div class="col-m-6">
<div class="dashboard-item" data-bind="scope:
'componentOne'">
<div class="dashboard-item-title" data-bind="text:
</div>
</div>
</div>
<div class="col-m-6">
<div class="dashboard-item" data-bind="scope:
'componentTwo'">
<div class="dashboard-item-title" data-bind="text:
title"></div>
<div class="dashboard-item-content">
</div>
</div>
</div>
</div>
<script type="text/x-magento-init">
{
"*": {
"Magento_Ui/js/core/app": {
"components": {
"componentOne": {
"component": "BelVG_Theme/js/component-one"
},
"componentTwo": {
"component": "BelVG_Theme/js/component-two"
}
}
}
}
}
</script>
return this;
}
http://prntscr.com/ma50wt
When we change the value of input (defaults.value), our second component
will import this value from the first. It will immediately be displayed in the
second component.
Now let's move on to the exports directive:
http://prntscr.com/ma6frs
Tracks o bject is used to convert our property to an observable object. If we
use the methods in question, we use this object.
Consider the listens d
irectory, d
elete the links directory and add:
listens: {
'value': 'valueChanged'
},
where
value is the name of the property to be tracked.
valueChange i s a function that will be called when the value changes.
As a result, we get this component
});
The essence of this listens property is that when the value that we are
listening to changes, an alert pops up. So, even if you export from the
second component to the first, the property will also change, and due to
this our alert will pop up.
Module sources:
https://github.com/m1kash/belvg-theme-module
Having compiled the .less file into the .css file, you'll see the
following:
.example-1 {
color:green;
}
.example-2 {
color:green;
@media screen a
nd (max-width: 768px) {
padding: 10px;
}
}
As a result, after compiling the .less file into a .css file, you get the
following:
&:hover{
color:
green;
}
&:before {
content: "!!!";
display: inline-block;
}
& + * {
magento_import '
//@
source/_module.less';
As a result, after preliminary processing of files by the built-in LESS
preprocessor, this directive will be replaced by the following:
...
mport '../Magento_Catalog/css/source/_module.less';
@i
mport '../Magento_Cms/css/source/_module.less';
@i
mport '../Magento_Customer/css/source/_module.less';
@i
...
This list will be huge since the preprocessor goes through all the modules
and adds @import d irectives for all module files at the given path and
name in the @magento_import directive.
It’s very convenient and helps to save time.
Then you need to clean the site cache.
It should be noted that CSS minification won’t work in the Developer mode.
Pay attention that CSS merging and minification can only be enabled in
case of the server-side compilation (with the client-side compilation, there
In the Production mode, CSS merging and minification is automatic with no
need to install the parameters above (there is no such parameters in the
admin in the Production mode).
Below you can find the paths to the main most customizable files from the
blocks we need (you just need to override it in your theme).
If you need to write additional styles for an element, create a file by the path
(/Vendor/Theme/Magento_Theme/web/css/source/_extend.less ).
If you prefer scss/sass, you can create a structure convenient to you:
Page header
● Header block
(/vendor/magento/module-theme/Block/Html/Header.php )
Changes apply to a specific product.
identifier is block_id, specified in the xml file:
It will look as follows:
1. Display mode. Choose between “Products Only”, “Products and Static
Block” and Static Block Only”.
2. Anchor. When enabled, all child products from child categories will be
displayed in the category.
3. Sort By. If you uncheck “all” (3.1), you can choose the parameter to
sort products into categories.
4. Default Products Listing Sort By parameter is here.
5. Step Settings to filter price.
To set up layered navigation, you can change the attributes’ order in the
admin on the path:
Choose “use for the layered navigation” to make the attribute work like a
filter and set the order to it (all attributes have a value of 0 by default).
Demonstrate an understanding of configuring
design inheritance for category pages.
Here we need to choose “Use Parent Category Setting”. As you see, the
other settings are inactive since they are inherited from the higher category:
How can a CMS block be configured as a category
landing page?
Select the previously created block with content in the Content section.
Then select “Static block only” or “static block and products” in the display
settings, depending on the design.
Indicate the needed containers and blocks in the new layout and register it
in the layouts.xml
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/
etc/layouts.xsd">
Demonstrate an understanding of static variables in
CMS blocks and pages.
Choose the widget type (the social media link, for example) in setting and a
theme to which we apply the widget and click “continue”
In the next section, specify the widget’s name and store view.
/widget>
<
</widgets>
namespace Belvg\CustomWidget\Block\Widget;
use M agento\Framework\View\Element\Template;
use Magento\Widget\Block\BlockInterface;
}
mplewidget.phtml
Demonstrate an understanding of the use of CMS
template directives (var, store, block, ...).
You can find the “insert variable” button in the content editor. It allows you
to insert your site data. They will dynamically change if the information
changes. There are no broken links when changing the site address or
working hours!
You can find some of them below:
● {{var your_variable} } is the template variable used to insert store
or customer data. You can also create your own custom ones and
use them.
As a result, we have the following link:
https://your_domain.com/custom_link/
Push the “Load template” button
Write the new name for the email template
Save the template pushing on “Save Template”
A list of variables:
var
( {{ order
.getCustomerName()}} works ):
<img =
src "
{{media url=
"custom-image.png" "
}} >
where the value of the url parameter is the path as to the media folder. You
can add an image through the wysiwyg editor and then add a link to it
<img =
src "
{{media url= "wysiwyg/custom-image.png" "
}} >
<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/pac
kage.xsd">
<code>de_DE</code>
<vendor>splendid</vendor>
<package>de_de</package>
<sort_order>100</sort_order>
<use vendor="oxford-university" package="en_us"/>
</language>
You can include multiple <use /> nodes in the l anguage.xml file. If
Magento 2 does not find a string in the included language pack, it will
search through each <use /> (and subsequently the <use/> nodes of this
language pack) until it finds a suitable translation.
<sort_order> is a priority for package downloading If there are several
language packs for the store.
Database translations
Database translations are the simplest but it’s hard to transfer from
installing Magento 2 to another. Translations can be found in the
translation table.
The easiest way to create a new translation is to enable the built-in
translation (Store > Configuration > Developer > Translate Inline).
There are 13 main cache types. Let’s consider each of them briefly and
then discuss how to work with them.
bin/magento deploy:mode:set {
mode
} [-s|--skip-compilation]
obligatory parameter(developer or production);
{mode} -
[-s|--skip-compilation] - optional parameter(used to skip
compilation when switching to developer mode)
bin/magento deploy:mode:set developer
If everything is correct, the following string will appear in the console:
Enabled developer mode.
To see the current mode, you need to use the command: