CakePHP1.3.6:コントローラーをダンプしてみる。

前回、前々回のついでに、Formの送信先のアクションでコントローラーをダンプしてみる。
FormのメソッドはPOSTにするので、前々回のTestFormをコピーして、TestForm3を作成する。
index()で以下の画面を表示する。

コントローラーは以下。

<?php

class TestForm3Controller extends AppController{
	
	public $name = 'TestForm3';
	public $uses = null;
	public $layout = 'myznala';
	public $autoLayout = true;
	public $autoRender = true;
	
	function index(){
		$this->set('title_for_layout', "コントローラーのテスト");
	}
	
	function receive(){
		$this->autoLayout = false;
		$this->set('title_for_layout', "コントローラーのテスト");

		var_dump($this);
	}
	
}
?>

ここで、以下の入力をする。

画面の実行ボタンで上のreceiveメソッド(アクション)が呼ばれ、以下の結果を得る。

拡大すると、以下のようになる。

object(TestForm3Controller)#21 (33) { ["name"]=> string(9) "TestForm3" ["uses"]=> NULL ["layout"]=> string(7) "myznala" ["autoLayout"]=> bool(false) ["autoRender"]=> bool(true) ["here"]=> string(39) "/workspace/cakesample/TestForm3/receive" ["webroot"]=> string(22) "/workspace/cakesample/" ["action"]=> &string(7) "receive" ["helpers"]=> array(3) { [0]=> string(7) "Session" [1]=> string(4) "Html" [2]=> string(4) "Form" } ["params"]=> &array(7) { ["controller"]=> string(9) "TestForm3" ["action"]=> &string(7) "receive" ["named"]=> array(0) { } ["pass"]=> array(0) { } ["plugin"]=> NULL ["form"]=> array(0) { } ["url"]=> array(8) { ["url"]=> string(17) "TestForm3/receive" ["text1"]=> string(9) "テスト" ["text2"]=> string(6) "tesuto" ["text3"]=> string(7) "hidden1" ["select1"]=> string(1) "3" ["select2"]=> array(2) { [0]=> string(1) "B" [1]=> string(1) "C" } ["radio1"]=> string(1) "b" ["check1"]=> array(2) { [0]=> string(3) "あ" [1]=> string(3) "う" } } } ["data"]=> NULL ["paginate"]=> array(2) { ["limit"]=> int(20) ["page"]=> int(1) } ["viewPath"]=> string(10) "test_form3" ["layoutPath"]=> NULL ["viewVars"]=> array(1) { ["title_for_layout"]=> string(33) "コントローラーのテスト" } ["modelNames"]=> array(0) { } ["base"]=> string(21) "/workspace/cakesample" ["Component"]=> object(Component)#22 (4) { ["__controllerVars"]=> array(3) { ["plugin"]=> NULL ["name"]=> string(9) "TestForm3" ["base"]=> string(21) "/workspace/cakesample" } ["_loaded"]=> array(1) { ["Session"]=> &object(SessionComponent)#24 (16) { ["__active"]=> bool(true) ["__bare"]=> int(0) ["valid"]=> bool(true) ["error"]=> bool(false) ["_userAgent"]=> string(32) "f5005c68d8c4da7e125461c6f284d1d0" ["path"]=> string(21) "/workspace/cakesample" ["lastError"]=> NULL ["security"]=> string(6) "medium" ["time"]=> int(1291122239) ["sessionTime"]=> int(1291134239) ["cookieLifeTime"]=> int(720000) ["watchKeys"]=> array(0) { } ["id"]=> NULL ["host"]=> string(9) "localhost" ["timeout"]=> NULL ["enabled"]=> bool(true) } } ["_primary"]=> array(1) { [0]=> string(7) "Session" } ["__settings"]=> array(0) { } } ["components"]=> array(1) { [0]=> string(7) "Session" } ["view"]=> string(4) "View" ["ext"]=> string(4) ".ctp" ["output"]=> NULL ["plugin"]=> NULL ["cacheAction"]=> bool(false) ["persistModel"]=> bool(false) ["passedArgs"]=> array(0) { } ["scaffold"]=> bool(false) ["methods"]=> array(2) { [0]=> string(5) "index" [1]=> string(7) "receive" } ["modelClass"]=> string(9) "TestForm3" ["modelKey"]=> string(10) "test_form3" ["validationErrors"]=> NULL ["__httpCodes"]=> NULL ["Session"]=> &object(SessionComponent)#24 (16) { ["__active"]=> bool(true) ["__bare"]=> int(0) ["valid"]=> bool(true) ["error"]=> bool(false) ["_userAgent"]=> string(32) "f5005c68d8c4da7e125461c6f284d1d0" ["path"]=> string(21) "/workspace/cakesample" ["lastError"]=> NULL ["security"]=> string(6) "medium" ["time"]=> int(1291122239) ["sessionTime"]=> int(1291134239) ["cookieLifeTime"]=> int(720000) ["watchKeys"]=> array(0) { } ["id"]=> NULL ["host"]=> string(9) "localhost" ["timeout"]=> NULL ["enabled"]=> bool(true) } }

色々つかい道がありそうですね。