{ID} - 3.5.2.1 $name

Pengguna PHP4 harus memulai definisi controller dengan menggunakan atribut $name. Atribut $name harus di set sebagai nama dari controller. Pada umumnya ini hanya merupakan nama dalam bentuk jamak (dalam bahasa Inggris) dari dari model utama yang digunakan di dalam controller ini. Hal ini dilakukan untuk mengatasi beberapa masalah pada penamaan class di PHP4 sekaligus membantu CakePHP mengatasi masalah penamaan.

<?php

#   $name contoh penggunaan atribut controller 

class RecipesController extends AppController {
   var $name = 'Recipes';
}

?>	
  1. <?php
  2. # $name contoh penggunaan atribut controller
  3. class RecipesController extends AppController {
  4. var $name = 'Recipes';
  5. }
  6. ?>

{EN} - 3.5.2.1 $name

PHP4 users should start out their controller definitions using the $name attribute. The $name attribute should be set to the name of the controller. Usually this is just the plural form of the primary model the controller uses. This takes care of some PHP4 classname oddities and helps CakePHP resolve naming.

<?php

#   $name controller attribute usage example

class RecipesController extends AppController {
   var $name = 'Recipes';
}

?>	
  1. <?php
  2. # $name controller attribute usage example
  3. class RecipesController extends AppController {
  4. var $name = 'Recipes';
  5. }
  6. ?>

Differences

Lines: 1-11Lines: 1-11
 <title>$name</title> <title>$name</title>
-<p>PHP4 users should start out their controller definitions using the <code&gt;$name</code> attribute. The <code>$name</code> attribute should be set to the name of the controller. Usually this is just the plural form of the primary model the controller uses. This takes care of some PHP4 classname oddities and helps CakePHP resolve naming.</p> +<p>Pengguna PHP4 harus memulai definisi controller dengan menggunakan atribut $name. Atribut $name harus di set sebagai nama dari controller. Pada umumnya ini hanya merupakan nama dalam bentuk jamak (dalam bahasa Inggris) dari dari model utama yang digunakan di dalam controller ini. Hal ini dilakukan untuk mengatasi beberapa masalah pada penamaan class di PHP4 sekaligus membantu CakePHP mengatasi masalah penamaan.</p>
 <pre> <pre>
 &lt;?php &lt;?php
-# $name controller attribute usage example +# $name contoh penggunaan atribut controller
 class RecipesController extends AppController { class RecipesController extends AppController {
  var $name = 'Recipes';  var $name = 'Recipes';
 } }