Codeigniter set_value not working |
I'm querying the DB and sending sending a $data array from my controller to my view, where I'm using CI's form helper with set_value(field_name, default) but the data is not being loaded.
This is what I'm currently doing in my view: Code: <input type="hidden" id="artist-id" name="record_artist_id" value="<?php echo set_value('record_artist_id', $record_artist_id); ?>"> I thought I had to use the input helper so I tried: Code: <label for="record-name"><span class="required">*</span>Name:</label> But still not working. This is working though: Code: <input id="record-name" name="record_name" type="text" value="<?php echo (isset($record_name)) ? $record_name : ''; ?>" class="form-control"> The form helper is being loaded in autoload.php Code: $autoload['helper'] = array('url', 'file', 'form', 'base'); I don't know if this is related but I'm getting the view as a string and then passing it to a template, something like: Code: public function add_content($view, $content = NULL){ and later on in a different method: Code: // render content Any idea about what I am doing wrong? PHP Code: <?php
i have the same problem the hidden fields arent set.
How can i solve it ? |
Welcome Guest, Not a member yet? Register Sign In |