Setup Directory ( Blog module Part-1 )

All the custom module should go under <magento root>/app/code

Create you module directory: app/code/Softanis/Blog

All of our codes for this blog module will reside under this directory.

Now create following mandatory files and folders under our module directory. app/code/Softanis/Blog

etc/module.xml
registration.php

etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Softanis_Blog" setup_version="1.0.0" />
</config>

The name attribute in the module tag is our CompanyName_ModuleName

registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Softanis_Blog',
    __DIR__
);

registration.php file is the entry point of our module.

Basic setup of our module is done. but, you will not see anything yet.
You need to enable the module first.
From your console: cd
Enable your module:

    php bin/magento module:status # Check status of each module
    php bin/magento module:enable Softanis_Blog # Enables the module
    php bin/magento setup:upgrade # This will make sure any setup scripts have been run and the current module version saved to the setup_module table.
    php bin/magento cache:flush

After running php bin/magento module:status you should see our module Softanis_Blog under List of disabled modules.
But, after running php bin/magento module:enable Softanis_Blog you should see Softanis_Blog under enabled module list.

We are done with module setup.

Please continue to next post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s