PIXNET Logo登入

ChouAndy 的學習筆記

跳到主文

這邊記載著我的學習點滴

部落格全站分類:心情日記

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 9月 27 週五 201318:48
  • Yii Framework 語法彙整

1. 取得網站根目錄 ( 例如:/seminar2014 )
<?php echo Yii::app()->request->baseUrl; ?>
2. 取得網站目前網址 ( 例如:/seminar2014/site/index )
<?php echo Yii::app()->request->requestUri; ?>
(繼續閱讀...)
文章標籤

ChouAndy 發表在 痞客邦 留言(0) 人氣(292)

  • 個人分類:Web Framework ( Yii )
▲top
  • 11月 23 週六 201314:32
  • git 移除所有暫存檔

git rm -r --cached .
(繼續閱讀...)
文章標籤

ChouAndy 發表在 痞客邦 留言(0) 人氣(23)

  • 個人分類:版本控制 ( Git )
▲top
  • 11月 23 週六 201313:45
  • 讓 Git Case Sensitive


用文字編輯器打開 .git/config ,找到 ignorecase = true ,然後把 true 改成 false 就可以了,如果沒有找到這行,就自己在 core 那個區塊裡加一行 ignorecase = false 也可以達到一樣的效果。
進到要修改的資料夾,在 terminal 輸入 git config core.ignorecase false ,可以讓目前的 git repository case sensitive。
(繼續閱讀...)
文章標籤

ChouAndy 發表在 痞客邦 留言(0) 人氣(20)

  • 個人分類:版本控制 ( Git )
▲top
  • 10月 22 週二 201310:14
  • Yii CDetailView row type list


raw: the attribute value will not be changed at all.
text: the attribute value will be HTML-encoded when rendering.
ntext: the formatNtext method will be called to format the attribute value as a HTML-encoded plain text with newlines converted as the HTML <br /> tags.
html: the attribute value will be purified and then returned.
date: the formatDate method will be called to format the attribute value as a date.
time: the formatTime method will be called to format the attribute value as a time.
datetime: the formatDatetime method will be called to format the attribute value as a date with time.
boolean: the formatBoolean method will be called to format the attribute value as a boolean display.
number: the formatNumber method will be called to format the attribute value as a number display.
email: the formatEmail method will be called to format the attribute value as a mailto link.
image: the formatImage method will be called to format the attribute value as an image tag where the attribute value is the image URL.
url: the formatUrl method will be called to format the attribute value as a hyperlink where the attribute value is the URL.
(繼續閱讀...)
文章標籤

ChouAndy 發表在 痞客邦 留言(0) 人氣(13)

  • 個人分類:Web Framework ( Yii )
▲top
  • 10月 06 週日 201321:40
  • Yii 使用 defaultScope() 載入 relations 資料

想要在一開始搜尋資料的時候,就載入關聯的資料表資料,可以使用下面方法:
1. 確認好 Model 裡的 relations()
public function relations(){
return array(
'creator' => array(self::BELONGS_TO, 'User', 'creator_id'),
);
}
(繼續閱讀...)
文章標籤

ChouAndy 發表在 痞客邦 留言(0) 人氣(71)

  • 個人分類:Web Framework ( Yii )
▲top
  • 10月 06 週日 201310:11
  • MySQL 的 Foreign Key 介紹

記得 MySQL 預設是不支援 Foreign Key 的功能,但其實 MySQL 中有相關的套件了,只是沒有開啟而已,InnoDB 是 MySQL 上第一個提供外鍵約束的表引擎。
如何啟動:請在 my.ini 中將 skip-innodb 這行用 # 號註解掉。
引用範例:
CREATE TABLE parent(
id INT NOT NULL,
PRIMARY KEY (id)
) ENGINE = INNODB;

CREATE TABLE child(
id INT,
parent_id INT,
INDEX par_ind (parent_id),
FOREIGN KEY(parent_id) REFERENCES parent(id) ON DELETE CASCADE
) ENGINE = INNODB;
-- 參數:
[ON DELETE {CASCADE | SET NULL | NO ACTION | RESTRICT}]
[ON UPDATE {CASCADE | SET NULL | NO ACTION | RESTRICT}]
(繼續閱讀...)
文章標籤

ChouAndy 發表在 痞客邦 留言(0) 人氣(787)

  • 個人分類:MySQL
▲top
  • 10月 04 週五 201316:59
  • Yii 使用 Module 的 layouts

例如: Module 名稱為 admin,只要在 AdminModule.php 內,新增以下程式碼即可:
public $layout = '/layouts/column2';

至於在 column2 內 載入 main.php 只要使用 /layouts/main 即可。
(繼續閱讀...)
文章標籤

ChouAndy 發表在 痞客邦 留言(0) 人氣(46)

  • 個人分類:Web Framework ( Yii )
▲top
  • 10月 02 週三 201310:28
  • Yii Framework 使用國際化 (I18N)

1. 修改 protected\config\main.php
return array(
...
'language' => 'zh_tw',
...
);
(繼續閱讀...)
文章標籤

ChouAndy 發表在 痞客邦 留言(0) 人氣(133)

  • 個人分類:Web Framework ( Yii )
▲top
  • 9月 29 週日 201314:08
  • 在 Yii framework 安裝 Fancybox 2 套件

手動安裝
1. 下載檔案 yii-fancybox
2. 將目錄 assets 及檔案 FancyBox.php 放到目錄 protected/extensions/fancybox 底下
(繼續閱讀...)
文章標籤

ChouAndy 發表在 痞客邦 留言(0) 人氣(81)

  • 個人分類:Web Framework ( Yii )
▲top
  • 9月 26 週四 201317:14
  • Sublime Text 安裝 syntax highlighting for .less 檔案

1. 安裝 Package Control 。
2. 使用 Package Control 搜尋 LESS。
(繼續閱讀...)
文章標籤

ChouAndy 發表在 痞客邦 留言(0) 人氣(108)

  • 個人分類:Sublime Text
▲top
123»

個人資訊

ChouAndy
暱稱:
ChouAndy
分類:
心情日記
好友:
累積中
地區:

文章分類

  • MySQL (1)
  • Sublime Text (1)
  • Composer (1)
  • 版本控制 ( Git ) (12)
  • Web Framework ( Yii ) (9)
  • HTML5 (1)
  • 網頁設計 (3)
  • 未分類文章 (1)

文章搜尋

參觀人氣

  • 本日人氣:
  • 累積人氣: