跳到主要內容

發表文章

目前顯示的是 9月, 2016的文章

Yii2 advanced (前後台版本) 在單一網址中執行

方法1 http://example.com/  - 前台 http://example.com/admin/  - 後台 指令如下 cd /path/to/project/frontend/web ln -s ../../backend/web admin Apache設定 <VirtualHost *:80> ServerName example.com DocumentRoot "/path/to/project/frontend/web" Options +FollowSymlinks ... </VirtualHost> Nginx設定 server { charset utf - 8 ; client_max_body_size 128 M ; listen 80 ; # # listen for ipv4 # listen [::]:80 default_server ipv6only=on; ## listen for ipv6 server_name mysite . local ; root / path / to / project / frontend / web ; index index . php ; ... } 方法2 frontend/config/main.php 設定如下 .... ' components ' => [ .... ' request ' => [ ' baseUrl ' => ' ' , ] , ' urlManager ' => [ ' scriptUrl ' => ' /index.php ' , ] , // use the followin

Yii2 composer 專案建立Token問題

在建立Yii2專案的時後如果使用composer會請你輸入一組token 此時只要將此URL貼在網址列上,並登入Github,即可得到Token 例:https://api.github.com/repos/RobinHerbots/Inputmask/commits/45xxxxxxxxx15xxxxx 此時複製,貼上即可建立專案。 例: x7dxxxxxxxx5fcxxxxxxxxxx18xxxxxxxxxxxxc0xxxxxxx