Ir para conteúdo
Fórum Script Brasil

Standart

Membros
  • Total de itens

    4
  • Registro em

  • Última visita

Sobre Standart

Standart's Achievements

0

Reputação

  1. Olá pessoal, estou com um probleminha que já me custou algumas horas de teste e até então não consegui encontrar a falha. Estou tentando carregar um arquivo de template do smarty da seguinte forma. Esse é o arquivo initial.php: <?php require_once 'config/config.php'; $smarty->display('survey/default/layout.phtml'); O arquivo config.php segue abaixo: <?php set_include_path("lib/" . PATH_SEPARATOR . "lib/Survey/" . PATH_SEPARATOR . "lib/Extra/" . PATH_SEPARATOR . "lib/Extra/" . PATH_SEPARATOR . "lib/Facebook/" . PATH_SEPARATOR. "config/" . PATH_SEPARATOR . get_include_path()); session_start(); require_once 'loader.php'; require_once 'smarty.php'; require_once 'db.php'; Nesse arquivo concentro o carregamento das minhas principais configurações. Mas quando minha requisição chega ao arquivo initial.php, linha: $smarty->display('survey/default/layout.phtml'); Gera o seguinte erro: "PHP message: PHP Notice: Undefined variable: smarty in /home/webmaster/app.groups.com.br/public_html/survey/engagement/first-2013/lib/Survey/views/survey/default/initial.php on line 6" Para verificar se o objeto está criado adicionei o seguinte teste no arquivo initial.php. print_r($GLOBALS); Result: [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17 [HTTP_ACCEPT_ENCODING] => gzip,deflate,sdch [HTTP_ACCEPT_LANGUAGE] => pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4 [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.3 [HTTP_COOKIE] => PHPSESSID=xxxxxxxxxxxxxxxxxxxxxx [PHP_SELF] => /survey/engagement/first-2013/index.php [REQUEST_TIME] => 1359602437 ) [smarty] => Smarty Object ( [auto_literal] => 1 [error_unassigned] => [use_include_path] => [template_dir:Smarty:private] => Array ( [0] => lib/Survey/views/templates/ ) [joined_template_dir] => lib/Survey/views/templates/ [joined_config_dir] => configs/ [default_template_handler_func] => [default_config_handler_func] => [default_plugin_handler_func] => [compile_dir:Smarty:private] => templates_c/ [plugins_dir:Smarty:private] => Array ( [0] => /home/webmaster/app.groups.com.br/public_html/survey/engagement/first-2013/lib/Smarty/libs/plugins/ ) [cache_dir:Smarty:private] => cache/ [config_dir:Smarty:private] => Array ( [0] => configs/ ) [force_compile] => [compile_check] => 1 [use_sub_dirs] => [allow_ambiguous_resources] => [caching] => [merge_compiled_includes] => [cache_lifetime] => 3600 [force_cache] => [cache_id] => [compile_id] => [left_delimiter] => { [right_delimiter] => } [security_class] => Smarty_Security [security_policy] => [php_handling] => 0 [allow_php_templates] => [direct_access_security] => 1 [debugging] => [debugging_ctrl] => NONE [smarty_debug_id] => SMARTY_DEBUG [debug_tpl] => file:/home/webmaster/app.groups.com.br/public_html/survey/engagement/first-2013/lib/Smarty/libs/debug.tpl [error_reporting] => [get_used_tags] => [config_overwrite] => 1 [config_booleanize] => 1 [config_read_hidden] => [compile_locking] => 1 [cache_locking] => [locking_timeout] => 10 [template_functions] => Array ( ) [default_resource_type] => file [caching_type] => file [properties] => Array ( ) [default_config_type] => file [template_objects] => Array ( ) [cache_modified_check] => [registered_plugins] => Array ( ) [plugin_search_order] => Array ( [0] => function [1] => block [2] => compiler [3] => class ) [registered_objects] => Array ( ) [registered_classes] => Array ( ) [registered_filters] => Array ( ) [registered_resources] => Array ( ) [_resource_handlers] => Array ( ) [registered_cache_resources] => Array ( ) [_cacheresource_handlers] => Array ( ) [autoload_filters] => Array ( ) [default_modifiers] => Array ( ) [escape_html] => [start_time] => 1359602437.0408 [_file_perms] => 420 [_dir_perms] => 505 [_tag_stack] => Array ( ) [smarty] => Smarty Object *RECURSION* [_current_file] => [_parserdebug] => [merged_templates_func] => Array ( ) [template_class] => Smarty_Internal_Template [tpl_vars] => Array ( ) [parent] => [config_vars] => Array ( ) ) [config] => Array ( [adapter] => mysql [hostname] => localhost [dbname] => db_groups [user] => groups [password] => xxxxxxxxxxx ) [_REQUEST] => Array ( ) [o_Application] => Survey_Application Object ( [st_controller:protected] => Index [st_action:protected] => index [namespace:protected] => Survey_ ) ) Ou seja, meu objeto smarty está lá, mas não consigo acessar a variável a partir do initial.php Se alguém puder ajudar fico bastante grato. Abraços
  2. Standart

    Select de gincana

    Ola amigos, ontem participei de uma gincana de SQL e tinha uma questão que não consegui resolver e fiquei bastante curioso de como resolver essa questão. Pergunta: Liste os codigos dos voos que possuem dia de saida impar e dia de chegada multiplo do codigo do aviao. Abaixo segue o link da imagem do modelo. Imagem do modelo Obrigado a todos.
  3. Standart

    Validação de Campos

    Olá amigo kuroi, segui o se conselho e fui a procura das dicas, até encontrei uma que ajudou bastante com relação a criação de mascara nos campos veja: Para telefone Private Sub txtFone1_Change() Dim texto As String If Len(txtFone1) = 2 Then txtFone1.Text = "(" + txtFone1.Text End If If Len(txtFone1) = 3 Then txtFone1.Text = txtFone1.Text + ")" End If If Len(txtFone1) = 8 Then txtFone1.Text = txtFone1.Text + "-" End If End Sub Só que encontri um problema, por exemplo. O usuario digita 21 ele logo coloca (21), em seguida usuario digita 5555 ela vai alterar pra (21)5555-, porém surge um problema se o usuário digitou o prefixo do telefone errado ele não deixa usar a tecla de backspace para colocar o numero correto, já tentei algumas alternativas usando Left$ testando se a tecla backspace foi pressionada, mas ainda não achei a solução, alguém sabe como posso contornar isso? Abraço a todos e muito obrigado!
  4. Olá amigos, estive procurando na internet sobre validaçãod e campos em vba, no entanto encontrei muita coisa para vb.net, mas para vba nada que pudesse dar uma luz de como desenvolver validadores de dados como Email, CPF, CNPJ, campos numericos e outros. A minha pergunta é: Tem como trazer para o vba recursos externos que permitar trabalhar numa validação como essa? Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If Not Char.IsLetterOrDigit(e.KeyChar) Then e.Handled = True End If End Sub O Vba desconhece isso por exemplo Handles. Espero ter sido claro. Grato a todos
×
×
  • Criar Novo...