Source for file Ethna_Plugin_Generator_Template.php
Documentation is available at Ethna_Plugin_Generator_Template.php
// vim: foldmethod=marker
* Ethna_Plugin_Generator_Template.php
* @author Masaki Fujimoto <fujimoto@php.net>
* @license http://www.opensource.org/licenses/bsd-license.php The BSD License
// {{{ Ethna_Plugin_Generator_Template
* @author Masaki Fujimoto <fujimoto@php.net>
* @param string $forward_name テンプレート名
* @param string $skelton スケルトンファイル名
* @param string $locale ロケール名
* @param string $encoding エンコーディング
* @return true|Ethna_Error true:成功 Ethna_Error:失敗
function &generate($forward_name, $skelton =
null, $locale, $encoding)
$this->ctl->setLocale($locale);
// ロケール名がディレクトリに含まれていない場合は、
$tpl_dir =
$this->ctl->getTemplatedir();
$tpl_path =
$this->ctl->getDefaultForwardPath($forward_name);
$entity =
$tpl_dir .
'/' .
$tpl_path;
$skelton =
'skel.template.tpl';
// add '_' for tpl and no user macro for tpl
$macro['_project_id'] =
$this->ctl->getAppId();
$macro['client_enc'] =
$encoding;
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("template file(s) successfully created [%s]\n", $entity);
Documentation generated on Fri, 11 Nov 2011 04:00:18 +0900 by phpDocumentor 1.4.3