CodeIgniter Forums
where should the form_template be copied to in DMZ extension method - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: where should the form_template be copied to in DMZ extension method (/showthread.php?tid=25650)



where should the form_template be copied to in DMZ extension method - El Forum - 12-19-2009

[eluser]rum1man001[/eluser]
Why is this not working??

Code:
<?php
class Students extends Controller{
    function __construct(){
        parent::Controller();
        }
    
    function index(){
        $s= new Student();
        $form_fields=array(
                       'id',                          
                      'sid',
                      'name'
                      );
        $url="sdb/form";
        $s->load_extension('htmlform');
        $this->load->view('f',array('student'=>$s,'form_fields'=>$form_fields,'url'=>$url));
        }
    }

I have assigned this in datamapper config:
Code:
$config['extensions'] = array('htmlform'=>array('form_template'=>'form','row_template'=>'row','section_template'=>'section'));

Please help!!


where should the form_template be copied to in DMZ extension method - El Forum - 12-20-2009

[eluser]rum1man001[/eluser]
am actually novice here. Actually in the posted code extension need not be loaded as it is loaded in the config file. No need to mention options if sum1 is using the default templates only copyin dmz_htmlform folder to views will do.


where should the form_template be copied to in DMZ extension method - El Forum - 12-20-2009

[eluser]BrianDHall[/eluser]
First, no need to load the extension twice. Either do it at run time in your controller, or in the datamapper.php configuration file, not in the ci config.php file. This is all laid out pretty well in: http://www.overzealous.com/dmz/pages/extensions/htmlform.html

Try to use the example first to get the hang of it, then go from there.