E
E
Evgeny Milushkin2014-01-13 14:02:58
Yii
Evgeny Milushkin, 2014-01-13 14:02:58

yii boiler plate. Installation Questions

Hello.
I recently started learning about Yii. I decided to use the ready-made YiiBoilerplate skeleton to immediately separate the backend and frontend applications.
Question 1. I understand that the Yii framework itself is not in this skeleton? If not, where to put it?
Question 2. In the file domain.ru/www/common/bootstrap.php I found the line

require_once ROOT_DIR . '/vendor/yiisoft/yii/framework/YiiBase.php';

In answer to 1 question, I understand that you need to create the vendor, yiisoft, yii directories, and put the framework itself here?
Question 3. Why is there an array with square brackets in the domain.ru/www/backend/config/overrides/base.php file?
<?php
/**
 * Base config overrides for backend application
 */
return [
    // So our relative path aliases will resolve against the `/backend` subdirectory and not nonexistent `/protected`
    'basePath' => 'backend',
    'import' => [
        'application.controllers.*',
        'application.controllers.actions.*',
        'common.actions.*'
    ],
    'controllerMap' => [
        // Overriding the controller ID so we have prettier URLs without meddling with URL rules
        'site' => 'BackendSiteController'
    ],
    'components' => [
        // Backend uses the YiiBooster package for its UI
        'bootstrap' => [
            // `bootstrap` path alias was defined in global init script
            'class' => 'bootstrap.components.Bootstrap'
        ],

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vit, 2014-01-13
@evgenmil

If not, where to put it?

You can "lay down" anywhere, the main thing is to specify the desired path when connecting the framework
See point 1. In general, by the presence of the vendor folder, I dare to assume that in your case it is proposed to install yii via composer. This is convenient, you can find many instructions on this topic on the Internet, but, as I wrote above, it is not necessary.
Since php 5.4 this is possible. Shorter entry.

A
Alexander Fedorov, 2014-03-16
@Pagliaccio

Question 1. All standard tools (Yii framework, Behat, Mink, MinkExtension, PHPUnit, tools from PHP Quality Assurance toolchain, Phing, ApiGen, Selenium and YiiBooster) are installed in YiiBoilerplate via Composer. It is Composer that creates the vendor folder and puts developer extensions into it. Today I finished translating their instructions , it turned out a little chaotic, I will refine it, but it helps to understand the general meaning.
Another question is that it seems to me more difficult to start learning with Yii with YiiBoilerplate than just with bare Yii.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question