Source for file Ethna_Plugin_Generator_ViewTest.php
Documentation is available at Ethna_Plugin_Generator_ViewTest.php
// vim: foldmethod=marker
* Ethna_Plugin_Generator_ViewTest.php
* @author Masaki Fujimoto <fujimoto@php.net>
* @license http://www.opensource.org/licenses/bsd-license.php The BSD License
// {{{ Ethna_Plugin_Generator_ViewTest
* @author Masaki Fujimoto <fujimoto@php.net>
* @param string $forward_name ビュー名
* @param string $skelton スケルトンファイル名
* @return true|Ethna_Error true:成功 Ethna_Error:失敗
function &generate($forward_name, $skelton =
null, $gateway =
GATEWAY_WWW)
$view_dir =
$this->ctl->getViewdir();
$view_class =
$this->ctl->getDefaultViewClass($forward_name, $gateway);
$view_path =
$this->ctl->getDefaultViewPath($forward_name .
'Test');
$entity =
$view_dir .
$view_path;
$skelton =
'skel.view_test.php';
$macro['project_id'] =
$this->ctl->getAppId();
$macro['forward_name'] =
$forward_name;
$macro['view_class'] =
$view_class;
$macro['view_path'] =
$view_path;
// original view script existence check.
$original_view_path =
$this->ctl->getDefaultViewPath($forward_name);
$original_view_entity =
$view_dir .
$original_view_path;
printf("[!!!!warning!!!!] original view script was not found.\n");
printf("[!!!!warning!!!!] You must generate it by the following command :\n");
printf("[!!!!warning!!!!] ethna add-view %s\n\n", $forward_name);
$user_macro =
$this->_getUserMacro();
printf("file [%s] already exists -> skip\n", $entity);
} else if ($this->_generateFile($skelton, $entity, $macro) ==
false) {
printf("[warning] file creation failed [%s]\n", $entity);
printf("view test(s) successfully created [%s]\n", $entity);
Documentation generated on Fri, 11 Nov 2011 04:00:20 +0900 by phpDocumentor 1.4.3