PHP BLT #6 2017-02-22 @ メルカリ 東京 (六本木ヒルズ)
7/2 (Sat) YAPC::Asia Hachioji in Shinagawa での発表資料です
Railsガイド解説セミナーのスライド資料です Railsガイド: http://railsguides.jp/ Railsガイド解説セミナー: http://railsguides.jp/options.html#seminar 【関連リンク】 Railsチュートリアル: http://railstutorial.jp/ Railsチュートリアル解説セミナー: http://railstutorial.jp/seminars Railsスクリーンキャスト: http://railstutorial.jp/screencasts Railsビギナーズ倶楽部: http://coedo-rails.doorkeeper.jp/
4. 名前空間を宣言する namespace宣言は必ずコードの先頭に記述すること。 (コメント、改行、スペースは宣言の前に書いてもよい) 名前空間は「」(バックスラッシュ)区切りで階層を構成できる。 <?php namespace HolyExample; //名前空間 ”HolyExample” を宣言 ちなみに、誤っていわゆるBOM付UTF-8でファイルを保存したところ、 こんなエラーで怒られてしまいました。 Fatal error: Namespace declaration statement has to be the very first statement in the script ※BOM付きUTF-8には気をつけて! 5. 名前空間でのクラス定義 名前空間で定義されるクラス/関数/定数は、先頭に名前空間を 付加したものとして解釈される。 namespace HolyEx
9. class CalculatorTest extends PHPUnit_Framework_TestCase { public function setUp() { $this->calc = new Calculator; } public function test_add_引数の和を返す() { $result = $this->calc->add(1, 2); $this->assertSame(3, $result); } } 10. class CalculatorTest extends PHPUnit_Framework_TestCase { public function setUp() { 1 $this->calc = new Calculator; } public function test_add_引数の和を返す() { $result = $this-
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く