Download the PHP package dvixi/yii2-alpaca-json without Composer

On this page you can find all versions of the php package dvixi/yii2-alpaca-json. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-alpaca-json

Yii2 alpacajs widget

NOTICE: module is under development, be carefull when using it!

Module allow to generate CRUD for given JSON and to store it in DB using json field (MySQL 5.7+, POSTGRESQL, etc). Based on AlpacaJS. Supports CkEditor for WYSIWYG editing and ElFinder for file management.

Install

Using composer.

Base configuring:

  1. add module to main.php config

    `

    or, add languages in bootstrap.php (if storing languages in DB with ActiveRecord)

    `

  2. for using with ckeditor and file management add to composer.json: For ElFinder add this config (to set storage path) into main.php config, components section:

  3. Add Gii config to config/main-local.php `

Gii usage

Fields:
Class - name of generated class (same for backend and frontemd)
Back module namespave - namespace of backend model
Front module namespave - namespace of frontend model
Controller base class - full classname with namespace witch will be extended for generating backend controller class
Json objects:
    Model attribute - name of php class property that will be storing inserted json object
    Json object - Json string with object

By default - gii openes with added 'pageSeo' property json, it may be used for storing page SEO data, customised or replaced

Note: yii2 Modules are not generated automatically! You must generate them by default Yii2 generator (and add them to app config), or it may be existing Modules.

Module architecture

Module generates Backend module files (controller, model and json string files with default data, pasted in 'Json object' field) and Frontend (only model).

Backend files allows editing json with AlpacaJs editor. Multilanguage supported. Backend controller made extendable from Your's own controller to make it fully controllable, for example with access-controlling.

Frontend model allows retrieving json data as php array (using json-decode). If you need raw json - you must override model afterFind() method as it contain replacing raw info with Json::decode() data.

Backend model configuring and AlpacaJs

Method getJsonAttributes() contain list of properties for storing Json objects, you may change it positions in array to change positions in displayable tabs.

Method rules() by default comes with 'safe' checking (as expected only front validation by AlpacaJS), but you may override this by your own needs.

Method getJsonConfig() - contains Json schema config where gii was inserted field names through Yii::t(). Required rules also was generated for all fields, you can replace it or even remove.

Method getJsonOptions() - most usable config. Through it you can customise field types (text input, file input, textarea, ckeditor, etc) or set AlpacaJS field options.

Most usable field types: 
    text - simple HTML text input
    textarea - textarea
    email - email field
    checkbox - checkbox input
    ckeditor - ckeditor widget with default config (you may customise it, see AlpacaJs docs)
    file - supported through small hack (data-attribute 'melonfile' and text field type)

Example file with all most used field types placed in 'example' folder.


All versions of yii2-alpaca-json with dependencies

PHP Build Version
Package Version
Requires evaisse/php-json-schema-generator Version ^2.0
ext-json Version *
yiisoft/yii2-jui Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dvixi/yii2-alpaca-json contains the following files

Loading the files please wait ...