Source for file Template.php
Documentation is available at Template.php
// vim: foldmethod=marker
* @author Masaki Fujimoto <fujimoto@php.net>
* @license http://www.opensource.org/licenses/bsd-license.php The BSD License
* @version $Id: 289541e22962ba4ef1ae15455675ad72d3b18d49 $
// {{{ 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 03:59:09 +0900 by phpDocumentor 1.4.3