Giter Club home page Giter Club logo

phalcon-blank's Introduction

Phalcon Boilerplate (Current version of beta 0.0.1)

========= This is a Boilerplate application written on Phalcon framework for the performance boost. This project created to develop applications in an easy way.

Includes
  • Multimodality

  • Multilanguage

  • Translation

Have fun :)

How to install

Using Composer (recommended)

Best way to install Boilerplate would be Composer, if you didn't install it

Run code in the terminal:

composer create-project artdevue/phalcon-blank /path/to/install
composer update
bower update

Using Git

First you need to clone the project, update vendors:

git clone https://github.com/artdevue/phalcon-blank.git ./project
cd project
composer update
bower update

Requirements

  • = PHP 5.5.x/5.6.x/7.0.x development resources (PHP 5.3 and 5.4 are no longer supported)

  • = Phalcon 3.0.2

Features

After setup you’ll have multimodule apps.

  • API RESTful module - responds all JSON-like requests.
  • BACKEND and FRONTEND - A multi-module application uses the same document root for more than one module.

Installing the module

If you want to install a new module, you need using the terminal run the following command

$ php apps/cli.php modules create modulename

modulename - replace it with the name of the module

For example, after executing the commands below in a terminal

$ php apps/cli.php modules create catalog

In the terminal, we see the report module installation

$ php apps/cli.php modules create catalog
Do you really want to install the module catalog?  Type 'yes' to continue: yes

Thank you, continuing...
Reading configuration file...
Creating a backup of the configuration file...
Record changes in the configuration file...
Create directories and files for this new module...
Installing the module is complete!
Use with pleasure!

After installing new module will be immediately available at http://site.com/catalog

The syntax of this command:

$ php apps/cli.php modules create $nameModule $prefixRouter $hostName
  • $nameModule - (String - Required value!) Your module name
  • $prefixRouter - (String) If the router prefix different from the module name, then enter here. If If you select - null - then there will be no prefix.
  • $hostName - (String) Host Name, if you want to have your module on another host. For example: http://catalog.site.com

Using Multilanguage

  • You must activate the "multilang => true" option in the configuration file.
  • Parameter "default_lang => 'en'" is assigned the default language (now is en)
  • Add an array of used languages in the project to the "languages" parameter of the configuration file
  1. The default language is displayed in URL address without prefixes. For example:
site.com, site.com/page
  1. If another language is used, then the prefix should be added at the beginning of the URL address. For example:
site.com/ua, site.com/ua/page
  1. Active language is called via config: In Controller $this->config->lang_active and in Volt config.lang_active

Using Translation (Source is taken here)

All files for translation are located in the directory specified in the configuration file with the parameter: name_lang_folder (default is the folder lang) and in the subfolder of the default language in the configuration file with the parameter: default_lang (default lang en)

The variable name consists of the file names and array keys in the file section.

The example of use in the controller:

$accepted = $this->trans->_("validation.accepted", ['attribute' => 'test']);

The example of use in the template volt:

{{ trans._("validation.accepted", ['attribute': 'test']) }}

License

The MIT License (MIT). Please see License File for more information.

Authors

Valentin Rasulov
artdevue.com
http://artdevue.com

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.