Download the PHP package monken/cli-create without Composer

On this page you can find all versions of the php package monken/cli-create. 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 cli-create

CodeIgniter4_CLI-Create

Cli-Create is based on CodeIgniter4. It will help you generate template files more quickly when developing projects with CodeIgniter4.

中文使用說明

Guide

Install

Prerequisites

  1. CodeIgniter Framework 4.*
  2. Composer

Composer Install

Use Library

Open Terminal in Mac/Linux or go to Run > “cmd” in Windows and navigate to CodeIgniter4 project’s root:

Now, if you see the following message, the installation is successful.

Guide

create:controller

Create a new controller file.

Create a normal Controller

You can use :

Now, in "app/Controllers" You can see the new Contorller File like this :

Use "-nobase" Option

By default, creating a controller file will extends the BaseController class. If you don't want the default settings, you can use:

The "-nobase" option can be declared after other options.

Now, in "app/Controllers" You can see the new Contorller File like this :

Use "-usemodel" Option

When creating a Controller file, if you need to directly select the Model that will be used, you can use this option.

The "-usemodel" option can be declared after other options.

Now, in "app/Controllers" You can see the new Contorller File like this :

Custom namespace

When creating a Controller file, if you need a custom namespace, you can use the following options:

The "-space" option can be declared after other options.

The namespace in Codeigniter usually maps the actual file storage path, so using this command will automatically create folders according to the value you entered.

Now, in “app/Controllers/System/Admin” You can see the new "-nobase" Controller File like this :

create:controller -rest

Unlike traditional controllers, Codeigniter provides a way to quickly build a RESTFul API. Of course, the CLI-Create library can help you quickly create these files and automatically generate the required settings for you.

Create a normal RESTFul Controller

When you do not need any settings, you can directly execute the following command:

Now, in “app/Controllers” You can see the new RESTFul Controller File like this :

Then, go to "app / Config / Routes.php" and you will see that the routing settings for this Controller have been registered in your configuration file :

Please note that the function of automatically writing to the configuration file is to find the relative position through the comments in the file. Please do not change the comment in the official configuration file, so as not to write the wrong place and cause a program error.

Create RESTFul API with different route name and controller name

You may use this option frequently. Sometimes, our router will not be associated with the location where the Controllers are stored, then it is very suitable to use this option.

The "-d" option allows you to customize the router, and "-space" allows you to customize the controller's namespace. We believe that this requirement needs to be met using these two options, so please use this example to demo.

The “-d” option can be declared after other options.

Now, in “app/Controllers/System/Api” You can see the new RESTFul Controller File like this :

Then, go to "app / Config / Routes.php" and you will see that the routing settings for this Controller have been registered in your configuration file :

Create "WebSafe" RESTFul API

codeigniter allows you to add the "web safe" attribute when setting routes to have it generate update and delete methods that work with HTML forms

The “-w” option can be declared after other options.

Then, go to "app / Config / Routes.php" and you will see the websafe attribute appear in the router's settings.

Create RESTFul API and limit the routes made

You can restrict the routes generated with the option. Only routes that match one of these methods will be created. The rest will be ignored.

The “-o” option can be declared after other options.

Now, in “app/Controllers/System/Api” You can see the new RESTFul Controller File like this :

Then, go to "app / Config / Routes.php" and you will see that the routes you allow to be created are recorded in the router setting :

create:controller -model

Create a new model for use with the new controller.

Create new controller and model

Cli-Create provides a way for you to create a controller and a model at the same time. You can accomplish this with a single line of "spark" command.

Now, open app / Controllers / Blog.php and you should see the new controller file, and the correct model namespace has been written:

Then, open app / Models / BlogModel.php and you will see that the models required by this controller have been created at the same time:

Of course, you can also use all the options provided by "create:controller" when using this command, like this:

Now, open app / Controllers / Notice.php and you should see the new "-nobase" controller file:

Then, open app / Models / NoticeModel.php and you will see that the models required by this controller have been created at the same time:

Use model options

The create:model command provides a variety of different models for you to choose freely. Of course, you can specify some options you want while creating the model and controller.

The options you use must be immediately after "=". You can refer to all the options mentioned in create:model for these options.

Now, open app / Controllers / Blog.php and you should see the new controller file, and the required model has been declared:

Then, open app / Models / BlogModel.php and you will see that the "-basic" model required by this controller has been created at the same time:

Use multiple model options

If you need to use multiple model options at the same time, you only need to separate them with a comma, like this:

This example is more complicated. create new controller, new model and entitiey, and customize the namespace.

Create RESTFul controller and model

You can also create models in "create:controller -rest" at the same time.

This example is more complicated. create new RESTFul controller, new model and entitiey, and customize controller namespace.

create:model

Create a new model file.

Create a normal model

The model class has a few configuration options that can be set to allow the class’ methods to work seamlessly for you.

You can use :

Now, in "app/Models" You can see the new Model File like this :

Create a basic model

Use Command:

Now, in “app/Models” You can see the new basic Model File like this :

This empty class provides convenient access to the database connection, the Query Builder, and a number of additional convenience methods.

You would replace “group_name” with the name of a defined database group from the database configuration file.

Create a manual model

If you do not need to extend any special class to create a model for your application. All you need is to get an instance of the database connection.

You can use this:

Now, in “app/Models” You can see the new Manual Model File like this :

Create a entity model

CodeIgniter supports Entity classes as a first-class citizen in it’s database layer, while keeping them completely optional to use. They are commonly used as part of the Repository pattern, but can be used directly with the Model if that fits your needs better.

You can use this command :

Now, in “app/Models” You can see the new Manual Model File like this :

And in “app/Entitsies” You can see the new Manual Model File like this :

Custom namespace

When creating a Model FILE, if you need a custom namespace, you can use the following options:

The "-space" option can be declared after other options.

The namespace in Codeigniter usually maps the actual file storage path, so using this command will automatically create folders according to the value you entered.

Now, in “app/Models/Api/System” You can see the new Manual Model File like this :


All versions of cli-create with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
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 monken/cli-create contains the following files

Loading the files please wait ....