Coder Social home page Coder Social logo

blog's Introduction

Yii 2 Advanced Project Template


Yii 2 Advanced Project Template is a skeleton Yii 2 application best for developing complex Web applications with multiple tiers.

The template includes three tiers: front end, back end, and console, each of which is a separate Yii application.

The template is designed to work in a team development environment. It supports deploying the application in different environments.

Documentation is at docs/guide/README.md.

Latest Stable Version Total Downloads Build Status

DIRECTORY STRUCTURE

common
    config/              contains shared configurations
    mail/                contains view files for e-mails
    models/              contains model classes used in both backend and frontend
    tests/               contains tests for common classes    
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
    tests/               contains tests for backend application    
    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
    tests/               contains tests for frontend application
    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

blog's People

Contributors

haohonglong avatar

Watchers

James Cloos avatar  avatar

blog's Issues

vue 里用jQuery trigger 失效的解决方法

vue 里用原生的触发事件可以解决这个问题,如:
$("#dir a[data-id='7']").trigger("click");//没有效果
换成下面写法就可以:
$("#dir a[data-id='7']")[0].click(); //有效果

yii2 cookies

Sending Cookies 时,有exit;的话一定要加Yii::$app->response->send();(这个在yii2 的文档里没有写有点坑)
⚠️注意:
读取:用Yii::$app->request->cookies;
设置:用Yii::$app->response->cookies;
php 设置cookie
错误的用法: $_COOKIE["name"] = "xxx" ;
正确的用法: setcookie(‘name’,'value');
yii Cookies 与php原生setcookie方法的不同:
1.setcookie 保存的是普通字符串,Sending Cookies 保存的是经 \yii\web\Cookie 对象处理后的数据,然后serialize 再保存到setcookie 里。
2.yii Cookies 可以用yii2 特有的方式验证

docker 中 gii && debug

if (!YII_ENV_TEST) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
'allowedIPs' => ['127.0.0.1', '::1',$_SERVER['REMOTE_ADDR']],
];

$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
    'class' => 'yii\gii\Module',
    'allowedIPs' => ['127.0.0.1', '::1',$_SERVER['REMOTE_ADDR']],
];

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.