Lançado Adianti Framework 7.6!
Clique aqui para saber mais
Abrir um arquivo .html em um THtml Galera estou tentando carregar um arquivo html que tem somente um texto para o componente THtml mas dá um erro, alguém poderia me dar uma luz? ...
MO
Abrir um arquivo .html em um THtml  
Galera estou tentando carregar um arquivo html que tem somente um texto para o componente THtml
mas dá um erro, alguém poderia me dar uma luz?

  1. <?php
  2. /**
  3.  * StepbyStepForm report
  4.  *
  5.  * @version    1.0
  6.  * @package    samples
  7.  * @subpackage tutor
  8.  * @author     Pablo Dall'Oglio
  9.  * @copyright  Copyright (c) 2006-2011 Adianti Solutions Ltd. (http://www.adianti.com.br)
  10.  * @license    http://www.adianti.com.br/framework-license
  11.  */
  12. class FormFaixa1View extends TPage
  13. {
  14.     private $notebook;
  15.     private $form;
  16.     private $page1;
  17.     private $page2;
  18.     
  19.     /**
  20.      * Class constructor
  21.      * Creates the page and the registration form
  22.      */
  23.     function __construct()
  24.     {
  25.         parent::__construct();
  26.         
  27.         // create the notebook
  28.         $this->notebook = new TNotebook(400250);
  29.         
  30.         // create the form
  31.         $this->form = new TForm;
  32.         //print($this->form->getName());
  33.         
  34.         // creates the notebook page
  35.         $page1 = new TTable;
  36.         $page2 = new TTable;
  37.         
  38.         // add the notebook inside the form
  39.         $this->form->add($this->notebook);
  40.         
  41.         // adds the notebook page
  42.         $this->notebook->appendPage('Localiza Titular'$page1);
  43.         $this->notebook->appendPage('Texto Declaração'$page2);
  44.         
  45.         //Criando o componente HTML
  46.         $html  = new THtmlEditor('observacao');
  47.         $html->setSize(970200);
  48.         $texto = new THtmlRenderer('./app/resources/declaracaofaixa01.html');
  49.         $html->setValue($texto);
  50.         // create the form fields
  51.         $cod_titular   = new  ">TDBSeekButton('cod_titular''permission''my_form''Titular''nome','cod_titular','nome_benef');
  52.         $nome_benef = new TEntry('nome_benef');
  53.         //$field3 = new TEntry('field3');
  54.         
  55.         $nome_benef->setSize(350);
  56.         // add a row for one field
  57.         $row=$page1->addRow();
  58.         $row->addCell(new TLabel('Localiza Titular'));
  59.         $cell $row->addCell$cod_titular );
  60.         
  61.         // add a row for one field
  62.         $row=$page1->addRow();
  63.         $row->addCell(new TLabel('Nome do Titular:'));
  64.         $cell $row->addCell$nome_benef );
  65.         // add a row for one field
  66.         $row=$page2->addRow();
  67.         $cell $row->addCell$html );
  68.         
  69.         $buttonsave=new TButton('save');
  70.         $buttonsave->setAction(new TAction(array($this'onSave')), 'Save');
  71.         $buttonsave->setImage('ico_save.png');
  72.         $row=$page1->addRow();
  73.         $row->addCell$buttonsave );
  74.         
  75.         // add a row for one field
  76.         //$row=$page2->addRow();
  77.         //$row->addCell(new TLabel('Field 3:'));
  78.         //$cell = $row->addCell( $field3 );
  79.         
  80.         
  81.         // define wich are the form fields
  82.         $this->form->setFields(array($cod_titular$nome_benef$html,  $buttonsave ));
  83.         //$this->formFields[] = $cod_titular;
  84.         //$this->form->setFields( $this->formFields );
  85.         
  86.         // add the form inside the page
  87.         parent::add($this->form);
  88.     }
  89.     
  90.     function onSave()
  91.     {
  92.         $this->notebook->setCurrentPage(2);
  93.         $this->form->setData($this->form->getData());
  94.         new TMessage('info'json_encode($this->form->getData()));
  95.     }
  96. }
  97. ?>

Pacotão Dominando o Adianti Framework 7
O material mais completo de treinamento do Framework.
Curso em vídeo aulas + Livro completo + Códigos fontes do projeto ERPHouse.
Conteúdo Atualizado! Versão 7.4


Dominando o Adianti 7 Quero me inscrever agora!

Comentários (2)


LG

Porque nao usa file_get_contents ao inves de Thtmlrender?
MO

kkkk deu certo eu já tinha usado, mas de outra forma eu só substitui o render, valeu muito obrigado pela atenção. ficou assim:

  1. <?php
  2.         //Criando o componente HTML
  3.         $html  = new THtmlEditor('observacao');
  4.         $html->setSize(970200);
  5.         $texto file_get_contents('./app/resources/declaracaofaixa01.html');
  6.         $html->setValue($texto);
  7. ?>