Welcome to the Cookbook

loading...

{JA} - インデント

インデントには1つのタブを使用します。

インデントは次のようになります:

<?php
// ベースレベル
    // レベル 1
        // レベル 2
    // レベル 1
// ベースレベル
?>
  1. <?php
  2. // ベースレベル
  3. // レベル 1
  4. // レベル 2
  5. // レベル 1
  6. // ベースレベル
  7. ?>

あるいは:

$booleanVariable = true;
$stringVariable = "moose";
if ($booleanVariable) {
    echo "Boolean value is true";
    if ($stringVariable == "moose") {
        echo "We have encountered a moose";
    }
}
  1. $booleanVariable = true;
  2. $stringVariable = "moose";
  3. if ($booleanVariable) {
  4. echo "Boolean value is true";
  5. if ($stringVariable == "moose") {
  6. echo "We have encountered a moose";
  7. }
  8. }

{EN} - Indentation

One tab will be used for indentation.

So, indentation should look like this:

<?php
// base level
    // level 1
        // level 2
    // level 1
// base level
?>
  1. <?php
  2. // base level
  3. // level 1
  4. // level 2
  5. // level 1
  6. // base level
  7. ?>

Or:

$booleanVariable = true;
$stringVariable = "moose";
if ($booleanVariable) {
    echo "Boolean value is true";
    if ($stringVariable == "moose") {
        echo "We have encountered a moose";
    }
}
  1. $booleanVariable = true;
  2. $stringVariable = "moose";
  3. if ($booleanVariable) {
  4. echo "Boolean value is true";
  5. if ($stringVariable == "moose") {
  6. echo "We have encountered a moose";
  7. }
  8. }

差分

Lines: 1-15Lines: 1-15
-<title>Indentation</title>
<p>One tab will be used for indentation.</p>
<p>So, indentation should look like this: </p>
+<title>インデント</title>
<p>インデントには1つのタブを使用します。</p>
<p>インデントは次のようになります: </p>
 <pre>&lt;?php <pre>&lt;?php
-// base level
// level 1
// level 2
// level 1
// base level
+// ベースレベル
// レベル 1
// レベル 2
// レベル 1
// ベースレベル
 ?&gt;</pre> ?&gt;</pre>
-<p>Or:</p> +<p>あるいは:</p>
 <pre> <pre>
 $booleanVariable = true; $booleanVariable = true;
 $stringVariable = "moose"; $stringVariable = "moose";
 if ($booleanVariable) { if ($booleanVariable) {