CakePHP 1.2.0.5427alpha リリース

CakePHP 1.2.0.5427alpha がリリースされました。
まだ alpha。


console 周りが結構変更されてます。
bake コマンドの元ファイルが template になったみたいですね。
妥当な流れだと思います。


とはいえ。
そのテンプレートの中身はこんなんなんですよ。

/cake/console/libs/templates/views/view.ctp より一部抜粋。

$i = 0;
foreach ($fields as $field) {
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}

	if (in_array($field['name'], array_keys($foreignKeys))) {
		$otherModelClass = $foreignKeys[$field['name']][1];
		$otherModelKey = Inflector::underscore($otherModelClass);
		$otherControllerName = Inflector::pluralize($otherModelClass);
		$otherControllerPath = Inflector::underscore($otherControllerName);
		if (isset($foreignKeys[$field['name']][2])) {
			$otherModelClass = $foreignKeys[$field['name']][2];
		}
		$otherSingularVar = Inflector::variable($otherModelClass);
		$otherModelObj =& ClassRegistry::getObject($otherModelKey);
		$otherPrimaryKey = $otherModelObj->primaryKey;
		$otherDisplayField = $otherModelObj->displayField;
		echo "\t\t<dt{$class}>".Inflector::humanize($otherModelClass)."</dt>\n";
		echo "\t\t<dd{$class}>\n\t\t\t<?php echo \$html->link(\${$singularVar}['{$otherModelClass}']['{$otherDisplayField}'], array('controller'=> '{$otherControllerPath}', 'action'=>'view', \${$singularVar}['{$otherModelClass}']['{$otherPrimaryKey}'])); ?>\n\t\t\t&nbsp;\n\t\t</dd>\n";
	} else {
		echo "\t\t<dt{$class}>".Inflector::humanize($field['name'])."</dt>\n";
		echo "\t\t<dd{$class}>\n\t\t\t<?php echo \${$singularVar}['{$modelClass}']['{$field['name']}']?>\n\t\t\t&nbsp;\n\t\t</dd>\n";
	}
}
?>
	</dl>
</div>


だめだ、やっぱりなじめない。。。


cake_smarty の対応はどうしよっかな。
今回はスルーして、ベータ版出てからにしよっかな。