Code Monkey home page Code Monkey logo

ysblog's Introduction

YII SPACE

for learning the yii2 php framework

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

需要仔细研究的项目

神器

参考

一些注意点

  • The CSS files are installed via Yii's recommended usage of the fxp/composer-asset-plugin v1.1.1 or later. 通过yii安装css文件
  composer global require "fxp/composer-asset-plugin:~1.2.0"  

这个据说是不推荐的方式

{
  "extra": {
    "asset-installer-paths": {
      "npm-asset-library": "vendor/npm",
      "bower-asset-library": "vendor/bower"
    }
  },
}

新方法用这个:

{"config":{
    "fxp-asset": {
        "installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        },
    }
}
}
  • bower|bower-assert不存在问题
"config": {
    "process-timeout": 1800,
    "fxp-asset": {
        "enabled": true
    }
},

此方法未验证 ,配置完后需要删掉vendor composer重新安装下依赖

另一个方案 也未验证:


"config": {
        "fxp-asset": {
            "installer-paths": {
                "npm-asset-library": "vendor/npm",
                "bower-asset-library": "vendor/bower"
            }
        }
    },

有点乱的感觉 😄, Composer Yii2 Bower: The file or directory to be published does not exis

  • 检查依赖

composer why -r nikic/php-parser

奇怪的bug

  • "schmunk42/yii2-giiant":"@dev", 这个库会导致奇怪的问题 估计是版本引起的

安装npm js库

以composer方式 来做npm的事情

https://www.yiiframework.com/doc/guide/2.0/en/structure-assets

先去这里asset-packagist搜索 按照php库的方式引入到composer.json 注意js库一般是npm|bower -asset 开头

db

ysblog's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.