Welcome Guest, Not a member yet? Register   Sign In
where should the form_template be copied to in DMZ extension method
#1

[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!!
#2

[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.
#3

[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/ext...lform.html

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




Theme © iAndrew 2016 - Forum software by © MyBB