1
私は小さな列挙型を作成しようとしていますが、私はちょうど立ち往生しています:なぜこれは機能しませんか?定数定義における連結
class.LayoutParts.php:
<?php
class LayoutParts {
const MAIN = 1;
const FOOTER = 2;
}
?>
class.SupportedLayouts.php:
<?php
class SupportedLayouts {
const MAIN = LayoutParts::MAIN;
const MAIN_FOOTER = LayoutParts::MAIN.LayoutParts::FOOTER;
}
?>
それは次のようなメッセージ結果:あなたの助けを
Parse error: syntax error, unexpected '.', expecting ',' or ';' in /*****/class.SupportedLayouts.php on line 4
感謝を!
よろしく、フロ
http://stackoverflow.com/questions/2236018/how-can-i-concatenate-a-constant-and-a-variable-and-store-it-in-a-class-constant 答えがそこにあるようです。 –