Class sm

Description

Configura o smarty

  1.  require_once('smarty.classe.php');
  2.  $sm new sm();
  3.  $sm->assign('var'$var);
  4.  $sm->js('j/foo.js');
  5.  $sm->display('index.tpl');

  • todo: rever $this->use_sub_dirs -> automatizar cfme plataforma

Located in /sm.classe.php (line 40)

Smarty
   |
   --sm
Variable Summary
string $strLang
Method Summary
static void getInstance ([ $template_dir = null], [ $compile_dir = null])
sm __construct ([string $template_dir = null], [string $compile_dir = null])
void js (string $tplName, [boolean $custom = false])
void jsSrc (string $src)
void outputMsgs ()
void setTemplateDir ([string $template_dir = null])
Variables
Methods
static method getInstance (line 55)

Singleton

  • access: public
static void getInstance ([ $template_dir = null], [ $compile_dir = null])
  • $template_dir
  • $compile_dir
Constructor __construct (line 83)

Configura o smarty

se null procura, NA ORDEM:

  • config.php:CFG_PATH.'/t'
  • config.php:CFG_LOCAL_FRAMEWORK.'/t'

sm __construct ([string $template_dir = null], [string $compile_dir = null])
  • string $template_dir: diretório para templates
  • string $compile_dir: diretório de armazenamento de templates compilados
js (line 145)

Exibe um código de javascript completo baseado em um template

Exemplo de template:

  1.  <script type="text/javascript">
  2.      function hello(txt){
  3.          alert(txt);
  4.      }
  5.      hello({!$saudacao});
  6.  </script>

  • access: public
void js (string $tplName, [boolean $custom = false])
  • string $tplName: nome do template com o código js
  • boolean $custom: indica se o js é do framework (false) ou do projeto (true)
jsSrc (line 158)

Gera a tag <script src="$src"> para um arquivo de javascript.

  • access: public
void jsSrc (string $src)
  • string $src: nome do arquivo com o código js da área web.
outputMsgs (line 115)

Traduz mensagens geradas pelo sistema e envia para o template

  1.  $_SESSION['msgs'][array('id'        => 16,
  2.                                'value'    => 'Já existe um usuário com o username "{!$username}"!',
  3.                                'classe'    => 'erro'
  4.                                'vars'    => array('username''juca'));

  • access: public
void outputMsgs ()
setTemplateDir (line 170)

Define o diretório de templates

  • access: public
void setTemplateDir ([string $template_dir = null])
  • string $template_dir: diretório para templates

Inherited Methods

Inherited From Smarty

Smarty::Smarty()
Smarty::append()
Smarty::append_by_ref()
Smarty::assign()
Smarty::assign_by_ref()
Smarty::clear_all_assign()
Smarty::clear_all_cache()
Smarty::clear_assign()
Smarty::clear_cache()
Smarty::clear_compiled_tpl()
Smarty::clear_config()
Smarty::config_load()
Smarty::display()
Smarty::fetch()
Smarty::get_config_vars()
Smarty::get_registered_object()
Smarty::get_template_vars()
Smarty::is_cached()
Smarty::load_filter()
Smarty::register_block()
Smarty::register_compiler_function()
Smarty::register_function()
Smarty::register_modifier()
Smarty::register_object()
Smarty::register_outputfilter()
Smarty::register_postfilter()
Smarty::register_prefilter()
Smarty::register_resource()
Smarty::template_exists()
Smarty::trigger_error()
Smarty::unregister_block()
Smarty::unregister_compiler_function()
Smarty::unregister_function()
Smarty::unregister_modifier()
Smarty::unregister_object()
Smarty::unregister_outputfilter()
Smarty::unregister_postfilter()
Smarty::unregister_prefilter()
Smarty::unregister_resource()
Smarty::_compile_resource()
Smarty::_compile_source()
Smarty::_dequote()
Smarty::_eval()
Smarty::_fetch_resource_info()
Smarty::_get_auto_filename()
Smarty::_get_auto_id()
Smarty::_get_compile_path()
Smarty::_get_plugin_filepath()
Smarty::_include()
Smarty::_is_compiled()
Smarty::_parse_resource_name()
Smarty::_process_compiled_include_callback()
Smarty::_read_file()
Smarty::_run_mod_handler()
Smarty::_smarty_cache_attrs()
Smarty::_smarty_include()
Smarty::_trigger_fatal_error()
Smarty::_unlink()

Documentation generated on Sun, 09 Mar 2008 23:53:05 -0300 by phpDocumentor 1.4.0

SourceForge.net Logo Support This Project