Yii Framework Forum

How to get started with Yii 3.0 application

(Alexander Makarov) #1

The project template for Yii 3.0 is located at https://github.com/yiisoft/yii-project-template.

Installation could be done like described in the corresponding README section of the template:

(Ricardo Pérez) #2

Thank you!

How can I run Gii inside Yii 3.0 template? I’ve tested using http://localhost:8080/index.php?r=gii without luck.

(Alexander Makarov) #3

It’s not ready yet.

(Alexander Makarov) #4

A good starting point for contributing is https://github.com/yiisoft/docs

(Ricardo Pérez) #5

Thank you very much! All of you are doing a great job.

(Alirz23) #6

where is the app logic, all I see is this

(Softark) #7

The main logic seems to reside in “yii-base-web” which is required in the composer.json of this template.

(Alexander Makarov) #8

Yes, that’s the idea.

For now template installs web part as default but that may be changed.

(Alexander Makarov) #9

(Ricardo Pérez) #10

So if I want to customize the provided controllers, models & views (like SiteController or User) I need to go into vendor/ dir and edit them there, right?

(Alirz23) #11

I don’t like the idea of editing files in vendor, this is plain out wrong imo

(Alexander Makarov) #12

Of course, no. You can add your own files.

Basic template vs new Yii 3.0 template
(Softark) #13

Most of the user files are under the “src” directory.
You can see the directory structure of “yii-base-web” here.

“yii-base-web” itself is a template.

(Arief Wijaya) #14

Lucky I read this comment first.

(Alirz23) #15

I am afraid changes introduced in yii3 template will only push people away from the framework and community at large, and will confuse new comers, you will see people creating a mishmash of structures.

I remember when I first started yii it was the ease of building applications, a sensible directory structure was in place and lot of the code was already provided out of the box which made it super easy building apps.

perhaps we can have 3 different template but projects created from these templates must contain the files and directory structure.


for those who have composer asset plugin installed, I think --no-plugins should be added, ideally it should be disabled in composer.json.

edit well, that will also disable composer-config-plugin and the app will not work.

(Alexander Makarov) #17

@alirz23 that’s likely to happen. That’s why Basic template vs new Yii 3.0 template


If I follow the steps above, I get an empty repo cloned without any dependencies installed…

$ composer create-project --prefer-dist --stability=dev yiisoft/yii-project-template myapp1
Installing yiisoft/yii-project-template (dev-master 5a515dfc28e36f36d54a283c83da7f987c25a4dc)
  - Installing yiisoft/yii-project-template (dev-master master): Loading from cache
Created project in myapp1
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

(Schmunk) #19

Please see the update installation instructions https://github.com/yiisoft/yii-project-template#installation

(Stefano Mtangoo) #20

Installing api does not generate vendor/bin/yii. Is that missing by design?