New IT forum
10 August 2022, 11:29:59 pm *
Welcome, %1$s. Please login or register.

: MiraBox now in stock.
Pages: [1]

Author Topic: Creating a Web service with the admin panel using Yii and Backvendor  (Read 9189 times)


  • Newbie
  • *
  • Posts: 1

Hi guys! Several days ago I've faced the quite interesting and perspective PHP-extension for the routine work  automation  called Backvendor. If you also have tried it please give us the feedback. For others  I've made the small review and tested the extension.

What is the Backvendor?

As I've said above the main  Backvendor objective is the maximum project automation. It helps much in the initial stages. With a few commands I've made the application architecture containing the web service and admin-panel, quickly set the CRUD for each model and made the relations between them. To my mind it looks much better and faster in comparison to the Yii standard tools.

The detailed information about how it works is available on the Yii website  ( and on the project homepage (

I identified the next main features that can be extremely useful (was taken form the official Backvendor page):

- Just one console command to create basic structure of your multi application system with common core.
- Backend engine that allows creating CRUD pages by setting configurations in Yii style.
-  Auto documentation of API version generated as a web page
- API versioning.
- Deployment script for moving your project to production server using Phing  (

How it works

There are 3 Steps I've made using the Backvendor to make the simple project.  You may also review the demo which I've found at the GitHub (

Step 1.

Download the extension from the site  ( and put it in the folder with web access (I did not change  name from backvendor). After that, type in the command line:

php bviic.php createmultiapp - path = "/path/to/webroot/my-demo-project"

In a few seconds we get the new project which is located in the my-demo-project. It already has a application structure and the base classes ready to tunning-up for the project purposes.

Step 2.

Before continuing we need to make the database migration (made before and provide the access  in the core/config/db.php). To do that type the next commands in the console:

php yiic migrate

Step 3.

Configuring the administration panel.

In the new project you will need to generate a model for the required tables with Gii Tool. Its settings are placed  in the file/core/config/main.php. During the model generation set the path for them Ā«core.modelsĀ»

Basic settings for CRUD and models are in the file backend / protected / controllers / SiteController.php, the function reconfigureEntityParamsDictionary. In my demo-project this function looks like:

 self::$entityConfigDictionary = CMap::mergeArray(
       parent::$entityConfigDictionary, array(
           'user' => array(
                'modelName' => 'User',
                'excludeFromGridView' => array(
                    'password', 'salt',
                'excludeFromDetailView' => array(
                    'password', 'salt',
                'modelAlias' => 'Blog User',
                'modelAliasPlural' => 'Blog Users',
                'bool' => array('admin'),
                'datetime' => array('creation_date'),
                'images' => array('image'),
                'title' => 'username',
                'link' => array(
                    'fb_link' => '{value}'
                'password' => array('password'),
                'dropDown' => array(
                    'role' => array(
                        1 => 'Publisher',
                        2 => 'Moderator',
                        3 => 'Writer',
                'maxUploadedImageSize' =>
                    array('width' => 200, 'height' => 200),
                'selectable' => 2,
            'post' => array(
                'modelName' => 'Post',
                'notUseTitleOfRelation' => array('author'),
            'postCategory' => array(
                'modelName' => 'PostCategory',
                'linksManyToManyRelation' => array('post', 'category')
            'category' => array(
                'modelName' => 'Category',
                'modelAliasPlural' => 'Categories',

That's all.

Each key in the array (User, Post, etc.) - is the name of the entity. The settings description you may find in -
Configuring entities properly will help you not  to create the CRUD for them manually, also  you don't have to edit the model.
The web service is placed in the folder apllication/webservice. It contains basic API class where you may define API methods.


1) Detailed information about the project is available here (

2) Project documentation:

Full list of documents (
Documentation for the API (
Deploying code (

3) What and where to download:

Backvendor  (
Demo-version of the project (
Pages: [1]

Powered by MySQL Powered by PHP SMF 2.0.10 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!