Home » Install Methods

This tutorial will show you how we can use dynamic model yii2.In some case, we do not want the model because we do not want to insert any data in the MySQL tables. But we need client-side and server-side validations to secure our functionality. To overcome this problem we have an option in yii2 to use dynamic models.

For DynamicModel we don’t need to create any file Or Class. Everything is already implemented by Yii we just need to define rules for our fields. For Example in the controller you can add like below:

In render view form is like

In above example i used only one filed amount you can add multiple. You can add all kinds of rule in Dynamic model.

Some example where we can use this Dynamic model is:
1. If we have some feedback page on our website.
2. we can also use the Dynamic model to get some information from users like phone number, email, etc.

Hope this will help you.

Introduction: Composer is package manager for the PHP. Composer for managing php dependencies and download php package, library, framework etc.

Summary: In this post, I am going to show you how we can download and install composer in Window. It is not much difficult to download just follow the below steps.

First of all, you need to on Composer official website with this https://getcomposer.org/download/ link.
For Windows system, we do not need to run any commands. Just simply click on Composer-Setup.exe. After download, we need to double click on .exe file setup. An installing window is open as I show below.

After clicking on the Next button a new window is open give your php path to the composer in most cases, it automatically gets php path. In my case, it is in C drive.

Now It just ready to install. just click on Install button.

Once installation completed click on Finish button.

To confirm whether it is installed or not go to command prompt (cdm) or press window+r from your keyboard.
Once cmd is open write here composer.

If you able to see above as I show in the image, Yes your composer installed successfully..
That’s all! 😊
Still, face any problem you can contact us we definitely help you👍.

Introduction: Yii2 is the fast-growing PHP framework. It has a lot of features like client-side and server-side validations, debug tools and a lot of extensions to work easier. It is the best framework for bigger websites.

Summary: There are two types of apps available to download Yii2 one is Basic which is useful for the small website which has no more panel only has frontend. Another one is Advanced which is useful for projects which have more than one panel. In this post, I am going to download both basic and advanced app.

Let’s start, first of all, we need the Composer. If you do not already have Composer installed, just follow the instruction on our post how to install composer.  If you had the Composer already installed before, make sure you use the latest version. You can update the Composer by running

composer self-update

Installing Yii2 basic application

To install Yii2 basic app you need to run below command into your XAMPP, WAMP or any server that you are using for your localhost:

composer create-project --prefer-dist yiisoft/yii2-app-basic basic

Make sure you do not have a basic folder in your directory. My localhost path in E drive and I am using XAMPP as you see in figure(1).

figure(1)

At the last in command basic is the directory name where you want to install a Yii2 basic app you can change it.

NOTE: Some time installing process need  Github token you can see the process to Generate Github token.

Once the installation process is completed you need to open your browser with this path http://localhost/basic/web/

 

If you are able to see the above image congratulations! Yii2 basic app installed successfully.

Installing Yii2 advanced application

Let’s start with the advanced app, like the basic app we need the same requirement composer for. You can then install the advanced application using the following commands:

composer create-project --prefer-dist yiisoft/yii2-app-advanced advanced

Again in the last of the command advanced is the directory name you can change the name of it .

After the download process completed. You need to run below commands:

cd advanced

This command takes us in the advanced directory then we need to the following command:

php init 

After running this command you have to set the environment there is two option available

[0] Development      [1] Production

As you can see in figure(2).

figure(2) .

You need to select 0 then it confirms for ‘Development’ environment, you need to type yes and press Enter. Your installation completed now.

Let’s see it in the browser for frontend  type localhost/advanced/frontend/web/  into you browser URL bar as you can see in figure(3)

figure(3)

For backend type localhost/advanced/backend/web/

That’s all! 😊
Still, face any problem you can contact us we definitely help you

Introduction: Laravel is a great PHP framework. It has a lot of features related to validations, working with array and some other security features. You can learn about laravel from laracasts here you can also find some
other good things about laravel.
Summery: In this post, I am going to show you how we can download laravel with the help of Composer.
If you want to know about the composer you can see my post How To Install Composer.

Let’s start,
There are two methods are available to install laravel. As I mentioned above I am going user to the composer to install the Laravel. First of all, we need the composer to install if you do not have please go to the link that I have given in the introduction. Once you have composer installed you need to run this command into your terminal (for Linux) OR in cmd (for window).

composer create-project --prefer-dist laravel/laravel laravelTest

This command will be download latest version of laravel if you want any specific version you just need add bit text in
it. For example, if I need 5.4 version then I need to write the command like below.

composer create-project --prefer-dist laravel/laravel laravelTest "5.4.*"

install laravel                                                                                                    figure(1)

Apart from this if you are going to install any version first you need to check PHP version that needed for laravel
version. You can check on the official website of laravel.

Let me explain you about laravelTest that I am using in command. This is only the folder in which I am going
to install Laravel. You should give a name according to your choice.

Once the installation process is completed you need to open your browser and write localhost/laravelTest/public into browser address bar. If you able to see below on your browser tab that means you have successfully installed laravel. install laravel                                                                                                figure(2).

That’s all!?.

 

Introduction: Lumen is laravel micro-framework which is used to create  REST APIs. It is very fast and small. There is a lot of features available in lumen either it is for validation or for authentification process. If you are going to make an App for Android, IOS or for web (angular, react js if you don’t want to use node js) the lumen would be the best option to work in server side.

Summary:  In this post, I am going to show you how to install lumen in your local machine.

Let’s start, There is two ways to install lumen one is via lumen Installer and another is via composer. I am going to be with the second one. Very first we need the composer to install lumen to download composer you can see our post how-to-install-composer.

Once you have composer installed you need to run below command in command prompt on your XAMPP or WAMP directory. In my case I have XAMPP in E drive I just go in my htdocs folder with the help cmd. As you can see figure(1).

composer create-project --prefer-dist laravel/lumen lumenTest

figure(1).

Here you can see at the last of command you can see write lumenTest. This is my folder name in where I want lumen to be downloaded. You can write any name as you want. Once the download process is completed you can see a folder name lumenTest is created in your drive where you run the above command.

If you want to check whether lumen installed or not. Start your localhost and write the proper path of your public folder. Like in my case it is http://localhost/lumenTest/public/ as I show in figure(2).

figure(2).

That’s all! ?
Still, face any problem you can contact us we definitely help you ?

how-to-generate-github-token

Summary: During installation of the composer dependency some time we cross the GitHub’s rate limit. In this case, we need to provide GitHub credentials to the composer by generating GitHub token manually. You can learn more from composer documentation  Composer documentation about Github API tokens. In this post, I am going to show you how we can generate GitHub token.
Let’s start,
First of all, we need a GitHub account if you have already login to it or you need to login create a new one by following this link GitHub login. When you have logged in go to the top right Image then follow the below:

                     Top right Image >> Settings >> Developer settings>>Personal access tokens



image(1).

After click on Personal access tokens, you have Generate new token option in the top right of the page. As I shown in image(1).
Now we need to click on Generate new token now ask you enter the description for your token. I just enter Test after this you can select scopes means access level of your token, I leave checkbox empty and just click on green  Generate token button at the end.  As shown in image(2).


image(2).

Now a new page is open with the generated token you need to copy this token and place it on any safe place so that you can access it multiple time. It is not going to show again in your GitHub account. Shown in the image(3).


image(3).

If you are downloading something with help of composer and it needs token just copy from here right click on your Terminal (for Linux) or Cmd (command prompt for Window) depends on what you are using then press Enter you process continue again.

That’s all! ?
Still, face any problem you can post your comment below we definitely help you ?

Back to top