file-uploadcodeigniter-2bonfire

CI Bonfire uploading in modules


Trying to have an upload button in one of my modules... First thing, the view in the browser is messed since cannot see the physical button...

Anyone done this to help out? Below is my view code...

<?php echo form_open_multipart($this->uri->uri_string(), 'class="form-horizontal"'); ?>
    <fieldset>
        <div class="control-group <?php echo form_error('products_product_title') ? `enter code here`'error' : ''; ?>">
            <?php echo form_label('Product Title'. lang('bf_form_label_required'), 'products_product_title', array('class' => "control-label") ); ?>
            <div class='controls'>
        <input id="products_product_title" type="text" name="products_product_title" maxlength="50" value="<?php echo set_value('products_product_title', isset($products['products_product_title']) ? $products['products_product_title'] : ''); ?>"  />
        <span class="help-inline"><?php echo form_error('products_product_title'); ?></span>
        </div>

        <div class="control-group <?php echo form_error('products_product_path') ? 'error' : ''; ?>">
            <?php echo form_label('Upload Card'. lang('bf_form_label_required'), 'products_product_path', array('class' => "control-label") ); ?>
            <div class='controls'>
        <input id="products_product_path" type="submit" name="submit_form" value="<?php echo set_value('products_product_path', isset($products['products_product_path']) ? $products['products_product_path'] : ''); ?>"  />
        <span class="help-inline"><?php echo form_error('products_product_path'); ?></span>
        </div>


        </div>



        <div class="form-actions">
            <br/>
            <input type="submit" name="save" class="btn btn-primary" value="Create products" />
            or <?php echo anchor(SITE_AREA .'/developer/products', lang('products_cancel'), 'class="btn btn-warning"'); ?>

        </div>
    </fieldset>
    <?php echo form_close(); ?>

Solution

  • You're missing a close near the top, which is probably affecting it.

    <fieldset>
        <div class="control-group <?php echo form_error('products_product_title') ? `enter code here`'error' : ''; ?>">
            <?php echo form_label('Product Title'. lang('bf_form_label_required'), 'products_product_title', array('class' => "control-label") ); ?>
            <div class='controls'>
                <input id="products_product_title" type="text" name="products_product_title" maxlength="50" value="<?php echo set_value('products_product_title', isset($products['products_product_title']) ? $products['products_product_title'] : ''); ?>"  />
                <span class="help-inline"><?php echo form_error('products_product_title'); ?></span>
            </div>
        </div>    <!-- this div needs to be added -->
    

    You close each control-group, before adding another control.