2017 © Pedro Peláez
 

library contact-form-for-nftheme

Extension kit for NF Theme

image

vicoders/contact-form-for-nftheme

Extension kit for NF Theme

  • Thursday, July 26, 2018
  • by Garung
  • Repository
  • 0 Watchers
  • 0 Stars
  • 91 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 30 Versions
  • 78 % Grown

The README.md

Create contact and subcribe form easy with ContactFormModule

It's an extension for our theme https://github.com/hieu-pv/nf-theme, (*1)

A. Before Install

Install Migrate and Form package.
  • Install Migrate and Form package is require !

Refer to the instructions here: - Migrate - Form, (*2)

B. Installation

Step 1: Install Through Composer
composer require vicoders/contact-form-for-nftheme
Step 2: Add the Service Provider

Open config/app.php and register the required service provider., (*3)

  'providers'  => [
        // .... Others providers 
        \Vicoders\ContactForm\ContactFormServiceProvider::class
    ],
Step 3: Run migrate command
  • Run 2 commands below to render file and run migrate:
php command contact:publish

php command migrate
Step 4: Register your option scheme

You can add your option scheme to functions.php, (*4)

All supported type can be found here - Input - Type, (*5)

use Vicoders\ContactForm\Abstracts\Input;
use Vicoders\ContactForm\Abstracts\Type;
use Vicoders\ContactForm\Facades\ContactFormManager;

ContactFormManager::add([
    'name'   => 'Contact',
    'type'   => Type::CONTACT,
    'style'  => 'form-1',
    'email_enable' => true, /* default - false */
    'email_variables' => [
        'name'  => 'NAME_FIELD',
        'email' => 'EMAIL_FIELD'
    ],
    'email_config' => [
        'domain_api'      => 'http://sendmail.vicoders.com/',
        'mail_host'       => 'HOST MAIL',
        'mail_port'       => 'PORT',
        'mail_from'       => 'EMAIL_FROM',
        'mail_name'       => 'YOUR NAME',
        'mail_username'   => 'EMAIL SEND',
        'mail_password'   => 'EMAIL PASSWORD',
        'mail_encryption' => 'tls',
    ],
    'email_template' => [
        [
            'name' => 'Template 1',
            'path' => 'PATH_TO_HTML_TEMPLATE',
            'params' => [
                'name_author' => 'Garung 123',
                'post_title'  => 'this is title 123',
                'content'     => 'this is content 123',
                'link'        => 'http://google.com',
                'site_url'    => site_url(),
            ]
        ],
        [
            'name' => 'Template 2',
            'path' => 'PATH_TO_HTML_TEMPLATE',
            'params' => [
                'example_variable' => 'demo'
            ]
        ]
    ],
    'status' => [
        [
            'id' => 1,
            'name' => 'pending',
            'is_default' => true
        ],
        [
            'id' => 2,
            'name' => 'confirmed',
            'is_default' => false
        ],
        [
            'id' => 3,
            'name' => 'cancel',
            'is_default' => false
        ],
        [
            'id' => 4,
            'name' => 'complete',
            'is_default' => false
        ]
    ],
    'fields' => [
        [
            'label'      => 'Text',
            'name'       => 'firstname', // the key of option
            'type'       => Input::TEXT,
            'attributes' => [
                'required'   => true,
                'class'       => 'col-sm-6 form-control',
                'placeholder' => 'Please fill field',
            ],
        ],
        [
            'label'      => 'Text',
            'name'       => 'lastname', // the key of option
            'type'       => Input::TEXT,
            'attributes' => [
                'required'   => true,
                'class'       => 'col-sm-6 form-control',
                'placeholder' => 'Please fill field',
            ],
        ],
        [
            'label'      => 'Email',
            'name'       => 'email', // the key of option
            'type'       => Input::EMAIL,
            'attributes' => [
                'required'   => true,
                'class'       => 'col-sm-12 form-control',
                'placeholder' => 'Please fill field',
            ],
        ],
        [
            'label'      => 'Phone',
            'name'       => 'phone',
            'type'       => Input::TEXT,
            'attributes' => [
                'required'   => true,
                'class'       => 'col-sm-12 form-control',
                'placeholder' => 'Please fill field',
            ],
        ],
        [
            'label'             => 'Choose Size',
            'name'              => 'choose-size',
            'type'              => Input::SELECT,
            'list'              => [
                '0'       => '--- option ---',
                'size-l'  => 'Size L',
                'size-x'  => 'Size X',
                'size-xl' => 'Size XL',
            ],
            'selected'          => 'size-xl',
            'selectAttributes'  => [
                'class' => 'col-sm-12 form-control',
            ],
            'optionsAttributes' => [
                'placeholder' => 'Please fill field',
                'required'          => true,
            ],
        ],
        [
            'label'      => 'Textarea',
            'name'       => 'textarea',
            'type'       => Input::TEXTAREA,
            'attributes' => [
                'required'          => true,
                'class'       => 'col-sm-12 form-control',
                'placeholder' => 'Please fill field',
            ],
        ],
        [
            'name'       => 'date',
            'type'       => Input::DATE,
            'attributes' => [
                'required'   => 'true',
                'class'       => 'col-sm-12 form-control email-inp-wrap',
                'placeholder' => __('Hãy nhập email của bạn', 'contactmodule'),
            ],
        ],
        [
            'value'       => 'Submit',
            'type'       => Input::SUBMIT,
            'attributes' => [
                'class'       => 'btn btn-primary btn-submit',
                'placeholder' => __('Hãy nhập email của bạn', 'contactmodule'),
            ],
        ],
    ],
]);

Notice: If selected attribute of Input::SELECT don't set, it'll automation check title of current page with items in list which you set at list attribute., (*6)

Step 5: Add shortcode

Automatic create a shortcode name nf_contact_form with a attribute name is require:, (*7)

[nf_contact_form name="{form_name}"]

Example:, (*8)

[nf_contact_form name="Contact"]
Step 6: Insert shortcode wherever you need

Very easy, (*9)

do_shortcode("[nf_contact_form name='Contact']")

Custom layout for paginator

You can change layout for pagination in resources/views/vendor/option/pagination/default.blade.php, (*10)

Last step

{tip} Drink tea and relax !, (*11)

The Versions

26/07 2018

dev-master

9999999-dev

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by Avatar Garung

26/07 2018

dev-dev_garung

dev-dev_garung

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by Avatar Garung

26/07 2018

v3.1.2

3.1.2.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by Avatar Garung

01/06 2018

v3.1.1

3.1.1.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by Avatar Garung

30/05 2018

v3.1.0

3.1.0.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by Avatar Garung

30/05 2018

v3.0.9

3.0.9.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by Avatar Garung

28/05 2018

v3.0.8

3.0.8.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by Avatar Garung

28/05 2018

v3.0.7

3.0.7.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by Avatar Garung

27/03 2018

v3.0.6

3.0.6.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by Avatar Garung

09/02 2018

v3.0.5

3.0.5.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by Avatar Garung

09/02 2018

v3.0.4

3.0.4.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by Avatar Garung

08/02 2018

v3.0.3

3.0.3.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by Avatar Garung

08/02 2018

v3.0.2

3.0.2.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by Avatar Garung

08/02 2018

v3.0.1

3.0.1.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by Avatar Garung

31/01 2018

v3.0.0

3.0.0.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

31/01 2018

v2.0.9

2.0.9.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

31/01 2018

v2.0.8

2.0.8.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

30/01 2018

v2.0.7

2.0.7.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

30/01 2018

v2.0.6

2.0.6.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

26/01 2018

v2.0.4

2.0.4.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

24/01 2018

v2.0.3

2.0.3.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

24/01 2018

v2.0.2

2.0.2.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

22/01 2018

v2.0.1

2.0.1.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

19/01 2018

v2.0.0

2.0.0.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

18/01 2018

v1.0.5

1.0.5.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

17/01 2018

v1.0.4

1.0.4.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

17/01 2018

v1.0.3

1.0.3.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

17/01 2018

v1.0.2

1.0.2.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

17/01 2018

v1.0.1

1.0.1.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv

17/01 2018

v1.0.0

1.0.0.0

Extension kit for NF Theme

  Sources   Download

MIT

The Requires

 

by hieupv