Ticket #1243 (closed bug: wontfix)
jForms - Impossible de charger les css et js nécessaires à jForms
| Reported by: | brunto | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Jelix 1.4 |
| Component: | jelix:forms | Version: | 1.2RC3 |
| Severity: | normal | Keywords: | |
| Cc: | Php version: | ||
| Hosting Provider: | Blocked By: | ||
| Documentation needed: | no | Blocking: |
Description
Lorsqu'un formulaire est assigné à une propriété de classe et que cette classe est passée directement au template, les fichiers JS et CSS ne sont pas chargés.
Exemple :
//Ne fonctionne pas
//Controller
function test() {
$rep = $this->getResponse('html');
$form = jForms::create('monFormulaire');
$a = array();
$b = new stdClass();
$b->form = $form;
$a[] = $b;
$tpl = new jTpl();
$tpl->assign('a', $a);
$rep->body->assign('MAIN', $tpl->fetch('testTpl'));
return $rep;
}
//Template
{foreach $a as $k=>$v}
{formfull $v->form, '#~#'}
{/foreach}
--------------------------------------------------------
//Fonctionne
//Controller
function test() {
$rep = $this->getResponse('html');
$form = jForms::create('monFormulaire');
$a = array();
$b = new stdClass();
$b->form = $form;
$a[] = $b;
$tpl = new jTpl();
foreach($a as $k=>$v)
$form = $v->form;
$tpl->assign('form', $form);
$rep->body->assign('MAIN', $tpl->fetch('testTpl'));
return $rep;
}
//Template
{formfull $form, '#~#'}
Change History
Note: See
TracTickets for help on using
tickets.
