• Stars
    star
    456
  • Rank 95,985 (Top 2 %)
  • Language
    PHP
  • License
    Other
  • Created over 9 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Example project implementing simple shop using Yii 2.0

Yii 2 shop example project

This is an example project implementing a shop created to help people learn Yii 2.0. It was created during 8 hours workshop performed in Ekaterinburg, Russia. The idea was to show how to deal with Gii, grids, filtering and other Yii 2.0 usage. It is by no means a complete shop script. It may contain bugs, shortcuts etc.

If you want to take over the project and develop it further, let @samdark know and you'll be granted permissions required.

There are slides from the workshop in Russian: http://slides.rmcreative.ru/2014/yii2-master/

It is built on top of advanced template which includes three tiers: front end, back end, and console, each of which is a separate Yii application.

DIRECTORY STRUCTURE

common
    config/              contains shared configurations
    mail/                contains view files for e-mails
    models/              contains model classes used in both backend and frontend
console
    config/              contains console configurations
    controllers/         contains console controllers (commands)
    migrations/          contains database migrations
    models/              contains console-specific model classes
    runtime/             contains files generated during runtime
backend
    assets/              contains application assets such as JavaScript and CSS
    config/              contains backend configurations
    controllers/         contains Web controller classes
    models/              contains backend-specific model classes
    runtime/             contains files generated during runtime
    views/               contains view files for the Web application
    web/                 contains the entry script and Web resources
frontend
    assets/              contains application assets such as JavaScript and CSS
    config/              contains frontend configurations
    controllers/         contains Web controller classes
    models/              contains frontend-specific model classes
    runtime/             contains files generated during runtime
    views/               contains view files for the Web application
    web/                 contains the entry script and Web resources
    widgets/             contains frontend widgets
vendor/                  contains dependent 3rd-party packages
environments/            contains environment-based overrides
tests                    contains various tests for the advanced application
    codeception/         contains tests developed with Codeception PHP Testing Framework

REQUIREMENTS

The minimum requirement by this application template that your Web server supports PHP 5.4.0.

INSTALLATION

Install via Composer

If you do not have Composer, you can install it by following the instructions at getcomposer.org.

You can then install the application using the following command:

git clone https://github.com/samdark/yii2-shop.git
composer self-update
composer global require "fxp/composer-asset-plugin:~1.1.1"
cd yii2-shop
composer install

GETTING STARTED

After you install the application, you have to conduct the following steps to initialize the installed application. You only need to do these once for all.

  1. Run command init to initialize the application with a specific environment.
  2. Create a new database and adjust the components['db'] configuration in common/config/main-local.php accordingly.
  3. Apply migrations with console command yii migrate. This will create tables needed for the application to work.
  4. Set document roots of your Web server:
  • for frontend /path/to/yii2shop/frontend/web/ and using the URL http://shop.local/
  • for backend /path/to/yii2shop/backend/web/ and using the URL http://admin.shop.local/

To login into the application, you need to first sign up, with any of your email address, username and password. Then, you can login into the application with same email address and password at any time.

More Repositories

1

yii2-cookbook

Yii 2.0 Community Cookbook
Makefile
1,439
star
2

sitemap

Sitemap and sitemap index builder
PHP
525
star
3

the-modal

Proper modal boxes
JavaScript
307
star
4

opensource-hate

Hate in OpenSource
281
star
5

yii2-webshell

Web shell allows to run yii console commands using a browser
PHP
225
star
6

php-fpm_tuner

A script to tune PHP-FPM
PHP
160
star
7

yii2-minimal

Yii 2 minimal application template
PHP
139
star
8

intellij-visual-studio-code-dark-plus

Visual Studio Code Dark Plus theme for JetBrains IDEs
135
star
9

hydrator

Allows extracting data from objects and getting objects from data
PHP
116
star
10

yiifeed

Pre-moderated news aggregator
CSS
103
star
11

Typograph

Класс для автоматического применения правил русской типографики для веб
PHP
100
star
12

Yeeki

Yii 1.1-based wiki
PHP
96
star
13

yiipowered

Yii powered websites showcase
PHP
91
star
14

yiiframework_ru_cookbook

Russian Yii 1.1 cookbook
85
star
15

yii-application-cookbook-2nd-edition-code

Code of the second edition of Yii Application Development Cookbook
PHP
82
star
16

yii2-psr-log-target

Yii 2.0 log target that is able to write messages to PSR-3 compatible logger
PHP
80
star
17

realpath_cache_tuner

Simple script that helps tuning PHP realpath cache
PHP
77
star
18

wnmp-dev

Development environment: Windows + nginx + MySQL + PHP
Batchfile
52
star
19

yiiframework-ru

yiiframework.ru
PHP
52
star
20

codemirror-autosuggest

CodeMirror autosuggest addon
JavaScript
47
star
21

intl-icu-data-tables

PHP intl extension, ICU data tables
PHP
37
star
22

codemirror-buttons

CodeMirror buttons addon
JavaScript
31
star
23

yii-jobs

A module and an application for Yii that provides a job-portal-like functionality
PHP
29
star
24

yii2-league-oauth2-server

Yii 2.0 implementation of PHP league OAuth2 server interfaces
PHP
28
star
25

slides

Alexander Makarov conference slides
HTML
26
star
26

a-guide-to-yii-grids-lists-and-data-providers

A guide to Yii framework grids, lists and data providers
25
star
27

yii-db-profiler

Yii profiler adjusted to deal with MySQL performance optimizations
PHP
24
star
28

icls-vs-code-dark-plus

Visual Studio Code Dark Plus-like color scheme for PhpStorm and other JetBrains IDEs
23
star
29

yii-fullajax

fullajax Yii playground
PHP
21
star
30

sack

This package implements "0-1 Knapsack Problem" algorithm i.e. allows to find the best way to fill a knapsack of a specified volume with items of a certain volume and value.
PHP
9
star
31

samdark

8
star
32

yii2-iconized-menu-widget

Menu with favicons for each item.
PHP
8
star
33

yiiframework-ru-phpbb-style

yiiframework.ru phpBB forum style
CSS
7
star
34

markdownru

markdown.ru website
PHP
7
star
35

github-actions-cookbook

7
star
36

opera-xdebug

Opera Xdebug extension
JavaScript
5
star
37

dotfiles

Various configs
Shell
4
star
38

yiifeed-redesign

HTML
4
star
39

samdark.github.io_source

Alexander Makarov English blog
HTML
3
star
40

arguments

Helps deciding A vs B
JavaScript
1
star
41

opencollective-calculator

Various calculations on exported OpenCollective CSV
PHP
1
star
42

phpunit_runInSeparateProcess_bug

PHP
1
star
43

samdark.github.io

HTML
1
star
44

yiipress

Blog / publishing engine powered by Yii3
PHP
1
star
45

plain_to_amnezia

Plain text domains list to AmneziaVPN converter
PHP
1
star