Download the PHP package andy87/yii2-file-crafter without Composer

On this page you can find all versions of the php package andy87/yii2-file-crafter. 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-file-crafter

Yii2 File Crafter

Yii2 File Crafter - library for generating a many templates with minimal differences

Content


Setup

Requirements

Composer

Add package to project

Using console

(Recommended)

Using: file `composer.json`

Open file composer.json, in section with key require add line:
"andy87/yii2-file-crafter": "dev-master"

dont forget update composer

- - - - -

Config

Config in the configuration file.

Minimum config

Full Config with all options

Using


Marks

Module use marks for replace variables in templates.

Example

for schema name Product Items replace marks:


Cache (optional)

Configuration for the cache folder with schema data.

Default configuration:


Source (optional)

Configuration for the source folder with templates files.

Default configuration:


Templates (required)

Array with groups of templates for use on generate files.

The source path may contain:

File source-template will be searched in the source folder.
Source folder path can be set in the configuration file. ( see Source )

The resultFile path may contain:

Content of the templates file rendered with the View method renderFile
And prepared with the $replaceList array contains all marks. ( see Marks )
And also passed to the render method:


Custom Fields (optional)

Array with custom fields for use custom variables in templates.
Using on template key wrapped in square brackets: {{%key%}}
Example: {{key_one}}, {{key_two}}...

Example simple config

with template:

___

Schema 1: Product Items
Field one = !!product!!
Field many = >>> products <<<

...generate...

Result: app/frontend/views/info--product_items.php

___

Schema 2: Category Group
Field label one = --category--
Field label many = +++categories+++

...generate...

Result: app/frontend/views/info--category_group.php


Autocomplete status

Key autoCompleteStatus contain status for autocomplete field Schema name in the form 200 populated values.

Variants: true or false(default)


Autocomplete list (optional)

Key autoCompleteList contain list of autocomplete field Schema name in the form self custom list.

Type: array


Preview status (optional)

Key previewStatus contain status for preview file content on hover icon in the form.

Variants: true(default) or false


Can delete (optional)

Key canDelete contain status for delete schema from the form.

Variants: true(default) or false


Parse data base (optional)

Key parseDataBase contain list of target for extend schema name list from database.

Variants: array with values:

Default empty;

Commands (optional)

Key commands contain list cli command for call before generate any file.
command make use of the {{variable}} in the command string ( see Marks )

Example: generate gii model for table name from schema name before generate fileContent

Default empty;

Events (optional)

Make use of the eventHandlers key to add a behavior to the module.

Example: add behavior FileCrafterBehavior to the module

Default null;

Before init

CrafterEvent::BEFORE_INIT before init module

After init

CrafterEvent::AFTER_INIT after init module

Come events has special properties...

Before generate

CrafterEventGenerate::BEFORE before generate all files

Before command

CrafterEventCommand::BEFORE before run cli command

Cmd

\andy87\yii2\file_crafter\components\models\Dto

After command

CrafterEventCommand::AFTER after run cli command

Before render

CrafterEventRender::BEFORE before render file

After render

CrafterEventRender::AFTER after render file

After generate

CrafterEventGenerate::AFTER after generate all files


Packagist


All versions of yii2-file-crafter with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-json 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 andy87/yii2-file-crafter contains the following files

Loading the files please wait ....