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. * Class constructor
  20. * Creates the page and the registration form
  21. */
  22. function __construct()
  23. {
  24. parent::__construct();
  25. // create the notebook
  26. $this->notebook = new TNotebook(400, 250);
  27. // create the form
  28. $this->form = new TForm;
  29. //print($this->form->getName());
  30. // creates the notebook page
  31. $page1 = new TTable;
  32. $page2 = new TTable;
  33. // add the notebook inside the form
  34. $this->form->add($this->notebook);
  35. // adds the notebook page
  36. $this->notebook->appendPage('Localiza Titular', $page1);
  37. $this->notebook->appendPage('Texto Declaração', $page2);
  38. //Criando o componente HTML
  39. $html = new THtmlEditor('observacao');
  40. $html->setSize(970, 200);
  41. $texto = new THtmlRenderer('./app/resources/declaracaofaixa01.html');
  42. $html->setValue($texto);
  43. // create the form fields
  44. $cod_titular = new ">TDBSeekButton('cod_titular', 'permission', 'my_form', 'Titular', 'nome','cod_titular','nome_benef');
  45. $nome_benef = new TEntry('nome_benef');
  46. //$field3 = new TEntry('field3');
  47. $nome_benef->setSize(350);
  48. // add a row for one field
  49. $row=$page1->addRow();
  50. $row->addCell(new TLabel('Localiza Titular'));
  51. $cell = $row->addCell( $cod_titular );
  52. // add a row for one field
  53. $row=$page1->addRow();
  54. $row->addCell(new TLabel('Nome do Titular:'));
  55. $cell = $row->addCell( $nome_benef );
  56. // add a row for one field
  57. $row=$page2->addRow();
  58. $cell = $row->addCell( $html );
  59. $buttonsave=new TButton('save');
  60. $buttonsave->setAction(new TAction(array($this, 'onSave')), 'Save');
  61. $buttonsave->setImage('ico_save.png');
  62. $row=$page1->addRow();
  63. $row->addCell( $buttonsave );
  64. // add a row for one field
  65. //$row=$page2->addRow();
  66. //$row->addCell(new TLabel('Field 3:'));
  67. //$cell = $row->addCell( $field3 );
  68. // define wich are the form fields
  69. $this->form->setFields(array($cod_titular, $nome_benef, $html, $buttonsave ));
  70. //$this->formFields[] = $cod_titular;
  71. //$this->form->setFields( $this->formFields );
  72. // add the form inside the page
  73. parent::add($this->form);
  74. }
  75. function onSave()
  76. {
  77. $this->notebook->setCurrentPage(2);
  78. $this->form->setData($this->form->getData());
  79. new TMessage('info', json_encode($this->form->getData()));
  80. }
  81. }
  82. ?>

Curso Dominando o Adianti Framework

O material mais completo de treinamento do Framework.
Curso em vídeo aulas + Livro completo + Códigos fontes do projeto ERPHouse.
Conteúdo Atualizado!


Dominando o Adianti Framework 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(970, 200);
  5. $texto = file_get_contents('./app/resources/declaracaofaixa01.html');
  6. $html->setValue($texto);
  7. ?>