2017 © Pedro Peláez
 

project landing-form

image

genesis-dev/landing-form

  • Monday, February 22, 2016
  • by genesisc
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Installation

composer create-project "genesis-dev/landing-form":"v0.1.1-beta" landing-form, (*1)

Configuring

/config/local.php - overwrites /config/main.php (using array_merge_recursive), (*2)

<?php
return [
    "db" => [ // Database settings
        'database_type' => '',
        'database_name' => '',
        'server' => '',
        'username' => '',
        'password' => '',
        'charset' => 'utf8',
    ],
    "telegram" => [ // Telegram settings
        "api_key" => "",
    ],
    "defaults" => [
        "mailer" => [ // SMTP settings
            "host" => '',
            "username" => '',
            "password" => '',
            "from" => '',
            "fromName" => "",
            "subject" => "",
            "to" => ["mail@example.com", "mail2@example.com"],
        ],
        "telegram" => [
            "channel_name" => "", // Telegram channel name (without @)
            "include" => ["email", "phone"], // Names of fields to include in messages
        ],
    ],
    "sites" => [
        "siteID" => [ // Array, similar structure to defaults and overwrites them. Key is siteID.
        ],
        "test_null" => [ // Configurations for tests
            "mailer" => false,
        ],
        "test_mail" => [
        ],
        "test_telegram" => [
            "mailer" => false,
            "telegram" => [
                "channel_name" => "genesis_orders",
            ],
        ],
        "test_all" => [
            "telegram" => [
                "channel_name" => "genesis_orders",
            ],
        ],
    ],
];

/config/main.php, (*3)

<?php
$config = [
    "defaults" => [
        "validators" => [
            "email" => function($str, $fields, $validators) { // $str - field value, $fields - other fields, $validators - other validators
                return !empty($str) && filter_var($str, FILTER_VALIDATE_EMAIL);
            },
            "phone" => function($str, $fields, $validators) {
                return !empty($str) && preg_match('/^((8|\+7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{7,10}$/', $str);
            },
        ],
    ],
    "table" => "landing_form", // Table name in DB
];

//......

Usage







The Versions

22/02 2016

dev-wo-client

dev-wo-client

  Sources   Download

The Requires

 

by Yevgeniy Maistrenko

22/02 2016

v0.1.2-beta

0.1.2.0-beta

  Sources   Download

The Requires

 

by Yevgeniy Maistrenko

22/02 2016

v0.1.1-beta

0.1.1.0-beta

  Sources   Download

The Requires

 

by Yevgeniy Maistrenko

22/02 2016

v0.1-beta

0.1.0.0-beta

  Sources   Download

The Requires

 

by Yevgeniy Maistrenko

20/01 2016

dev-master

9999999-dev

  Sources   Download

The Requires

 

by Yevgeniy Maistrenko