How to use EJ components with Laravel framework
What is Laravel
Laravel is a PHP web framework, designed to achieve Model View Controller architectural pattern in order to have a clean separation between the application logic and its presentation.
You can get more information on installation, system requirements, folder structure from the below link.
Laravel uses Web artisan, which is a command line interface used to build and run your application.
How to manage dependencies in Laravel
Laravel uses composer to manage its dependencies, with which you can include the third party libraries in your project using composer.json file. It automatically downloads and installs the dependencies that are specified in composer.json file.
To get more information on installation and usage, please check
How to create project in Laravel
After installing the composer tool, create a new Laravel project by following the steps provided below.
By executing the above command, you will see a Laravel project created in the target folder with the folder structure as given in Laravel documentation. Also, the dependencies used in your project will be updated and installed.
By default the project will be served to port 8000. If you want to serve your project to some other port number, you need to specify the port number as given below.
How to configure Laravel Project to use EJ components
Provided that you have created a simple project using Laravel framework, you need to add the EJ wrapper classes to the project to use Syncfusion components. Follow the steps described below to add the EJ wrapper classes.
In this example, we have created a folder named EJ in the root directory of Laravel project and copied the EJ wrapper classes to this folder. So the folder structure will look like,
Here EJ namespace is mapped to path “EJ/Src/”. So the composer will search for the EJ namespace in “EJ/Src/” folder, where the folder live in the root directory of your project.
How to render a simple Button control using Laravel
Now that we have configured the Laravel project to access EJ namespace, let us see how to render a simple EJ Button control.
Now, you will be able to use the EJ wrapper classes in Laravel project.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|