Base

The Base module helps to maintain all the common features of the ShineISP project. For instance we need in all the modules the localization module, so we have created a "language" service. The status value like active, disabled, of the records distributed in all the modules have to be handled by the Base module too.

A common and generic container module. This module helps to handle all other modules.

Prerequisites

You will need:

  • Git
  • Composer
  • Apache Configuration

Now we have to tell to our Apache webserver that we have a new site called myproject.com (the tld could be changed properly as you like) Open the /etc/hosts file and type:

127.0.0.1 myproject.com www.myproject.com

Create a new file by your preferite text editor I am using the "nano":

sudo nano /etc/apache2/sites-available/myproject.conf

and paste this text:

<VirtualHost *:80>
    ServerName myproject.com
    ServerAlias www.myproject.com
    DocumentRoot /var/www/PROJECT-FOLDER/public
    SetEnv APPLICATION_ENV "development"
    <Directory /var/www/PROJECT-FOLDER/public>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

and then enable the website configuration by this shell command:

sudo a2ensite myproject

and reload the Apache configuration by this shell command:

service apache2 reload

Getting Started

To get the application running, perform the following steps:

Create a new application by Zend Framework 2 cloning the Skeleton. After creation, paste the following JSON into the "composer.json" text file within the repositories section:

    [
        {
            "type": "vcs",
            "url": "https://github.com/shineisp/Base.git"
        }
    ],

Run the following commands from the console:

cd YOUR-INSTALLATION-PATH

then

composer update

Set the pdo.local.php with the mysql account

Import the data/*.sql dump into you MySQL database

Enable the module in the config/application.config.php

Now open your preferite browser and type:

http://www.myproject.com/.

Hooray! You will see the standard Zend Framework page! Now you can see the module in action! How simple was that??

Services

These are the common services shared in the whole project modules:

  • CountryService
  • RegionService
  • ProvinceService
  • LanguagesService
  • SettingsService
  • StatusService
  • MailService

Form Elements

If you need a common list, like the language list items in your own module:

  • Base\Form\Element\Languages
  • Base\Form\Element\Country
  • Base\Form\Element\Region
  • Base\Form\Element\Province
  • Base\Form\Element\Yesno
  • Base\Form\Element\Enadisabled

View Helpers

these are the view helpers used in this module that could be useful in your module:

  • youtube
  • socialSignInButton
  • headMeta
  • createMap
  • languagecodes
  • datetime
  • recurrence
  • languagesonsite
  • settings

In each module you can use these features by calling the service.

results matching ""

    No results matching ""