mojifan / moblog Goto Github PK
View Code? Open in Web Editor NEW一个基于Yii2的博客系统
License: MIT License
一个基于Yii2的博客系统
License: MIT License
hi,问你个问题
Yii官方advance例子,前后台独立开共用Yii核心,分别建立了Fronted和bacend文件夹,两个文件夹里面都有一个WEB文件夹,感觉完全独立分开。
而你这个博客前后台也是两个文件夹,独立开来,但是WEB目录是放在外面,共用一个WEB目录,一般做法都是这样的吗?
很多地方都use common/models/xx,Yii自动加载机制是怎么ruquire到common文件夹的,我在web/index.php看到引入了
require(__DIR__ . '/../common/config/bootstrap.php');
这个文件里面定义了很多别名
Yii::setAlias('common', dirname(__DIR__));
Yii::setAlias('frontend', dirname(dirname(__DIR__)) . '/frontend');
Yii::setAlias('backend', dirname(dirname(__DIR__)) . '/backend');
Yii::setAlias('console', dirname(dirname(__DIR__)) . '/console');
是否通过这里实现了Common的自动加载?
初学Yii,有空回答一下咯,谢谢!
我发现博客运行的时候,比如首页,我在/common/models/Content.php的find()方法,打印一个东西出来,你看刷新页面的时候,会发现打印两次,其他地方也是这样,刷新一次页面调用两次方法。是因为其他地方也调用了find吗。
我还觉得页面响应速度好慢。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.