title: string conversion error in array codeigniter
body: <p>On my controller I have a error on this line <code>'edit' =&gt; site_url('admin/users_group_controller_update') .'/'. $this-&gt;getId($controller)</code></p>
  
  <p><strong>When I refresh my page it throws the error Array to string conversion</strong></p>
  
  <blockquote>
    <p>A PHP Error was encountered Severity: Notice Message: Array to string
    conversion Filename: user/users_group_update.php Line Number: 47</p>
  </blockquote>
  
  <p>Not sure what to do on that because I need to add variable <strong>$controller</strong> in to <code>$this-&gt;getId($controller);</code> </p>
  
  <p><strong>What changes is best suited to make this work.</strong></p>
  
  <pre><code>&lt;?php
  
  class Users_group_update extends Admin_Controller {
  
  public function __construct() {
      parent::__construct();
      $this-&gt;load-&gt;model('admin/user/model_user_group');
  }
  
  public function index() {
  
      $data['title'] = "Users Group Update";
  
      $controller_files = $this-&gt;getInstalled($this-&gt;uri-&gt;segment(3)); 
  
      $data['controller_files'] = array();
  
      $files = glob(FCPATH . 'application/modules/admin/controllers/*/*.php');
  
      if ($files) {
  
          foreach ($files as $file) {
              $controller =  basename(strtolower($file), '.php');
  
              $do_not_list = array(
                  'customer_total',
                  'dashboard',
                  'footer',
                  'header',
                  'login',
                  'logout',
                  'menu',
                  'online',
                  'permission',
                  'register',
                  'user_total'
              ); 
  
              if (!in_array($controller, $do_not_list)) {
  
                  $data['controller_files'][] = array(
                      'name' =&gt; $controller,
                      'installed' =&gt; in_array($controller, $controller_files),
                      'edit' =&gt; site_url('admin/users_group_controller_update') .'/'. $this-&gt;getId($controller)
                  );
              }
          }
      }
  
      $this-&gt;load-&gt;view('template/user/users_group_form_update', $data);
  }
  
  public function getInstalled($name) {
      $controller_data = array();
  
      $this-&gt;db-&gt;select();
      $this-&gt;db-&gt;from($this-&gt;db-&gt;dbprefix . 'user_group');
      $this-&gt;db-&gt;where('name', $name);
      $query = $this-&gt;db-&gt;get();
  
      foreach ($query-&gt;result_array() as $result) {
          $controller_data[] = $result['controller'];
      }
  
      return $controller_data;
  }
  
  public function getId($controller) {
      $this-&gt;db-&gt;select();
      $this-&gt;db-&gt;from($this-&gt;db-&gt;dbprefix . 'user_group');
      $this-&gt;db-&gt;where('name', $this-&gt;uri-&gt;segment(3));
      $this-&gt;db-&gt;where('controller', $controller);
  
      $query = $this-&gt;db-&gt;get();
  
      return $query-&gt;row('user_group_id');
  }
  }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;?php echo Modules::run('admin/common/header/index');?&gt;
  
  &lt;div id="wrapper"&gt;
  &lt;?php echo Modules::run('admin/common/menu/index');?&gt;
  &lt;div id="page-wrapper" &gt;
  &lt;div id="page-inner"&gt;
  
  &lt;?php 
  
  $data = array(
  'class' =&gt; 
  'form-horizontal', 
  'id' =&gt; 
  'form-users-group'
  );
  echo form_open_multipart('admin/users_group_update' .'/'. $this-&gt;uri-&gt;segment(3), $data);?&gt;
  
  &lt;div class="panel panel-default"&gt;
  &lt;div class="panel-heading clearfix"&gt;
  &lt;div class="pull-left" style="padding-top: 7.5px"&gt;&lt;h1 class="panel-title"&gt;&lt;?php echo $title;?&gt;&lt;/h1&gt;&lt;/div&gt;
  &lt;div class="pull-right"&gt;
  &lt;a href="&lt;?php echo base_url('admin/users_group');?&gt;" class="btn btn-primary"&gt;Cancel&lt;/a&gt;
  &lt;button type="submit" class="btn btn-primary"&gt;Save&lt;/button&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="panel-body"&gt;
  
  &lt;?php echo validation_errors('&lt;div class="alert alert-warning text-center"&gt;', '&lt;/div&gt;'); ?&gt;
  
  &lt;div class="form-group"&gt;
  &lt;?php 
  $data = array(
  'class' =&gt; 'col-sm-2'
  );
  echo form_label('User Group Name', 'name', $data)
  ;?&gt;
  &lt;div class="col-sm-10"&gt;
  &lt;?php 
  $data = array(
  'id' =&gt; 'name', 
  'name' =&gt; 'name', 
  'class' =&gt; 'form-control', 
  'value' =&gt; set_value('name')
  );
  echo form_input($data)
  ;?&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;table class="table table-striped table-bordered"&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;td&gt;Controller Name&lt;/td&gt;
          &lt;td&gt;Access&lt;/td&gt;
          &lt;td&gt;Modify&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
  &lt;?php if ($controller_files) { ?&gt;
  &lt;?php foreach ($controller_files as $controllers) { ?&gt;
  &lt;tr&gt;
  
  &lt;td&gt;
  &lt;div class="clearfix"&gt;
  
  &lt;div class="pull-left"&gt;
  &lt;?php echo $controllers['name']; ?&gt;
  &lt;/div&gt;
  
  &lt;div class="pull-right"&gt;
  
  &lt;?php if ($controllers['installed']) { ?&gt;
  &lt;span class="label label-success"&gt;Installed&lt;/span&gt;
  &lt;span class="label label-danger"&gt;&lt;a style="color: #FFF; text-decoration: none;" href="&lt;?php echo $controllers['edit'];?&gt;"&gt;Edit Individual Controller&lt;/a&gt;&lt;/span&gt;
  &lt;?php } else { ?&gt;
  &lt;span class="label label-primary"&gt;Not Installed&lt;/span&gt;
  &lt;?php } ?&gt;
  
  &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;/td&gt;
  
  &lt;/tr&gt;
  &lt;?php } ?&gt;
  &lt;?php } ?&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  
  
  &lt;/div&gt;
  &lt;div class="panel-footer"&gt;
  &lt;/div&gt;
  &lt;/div&gt;&lt;!-- Panel End --&gt;
  &lt;?php echo form_close();?&gt;
  
  &lt;/div&gt;&lt;!-- # Page Inner End --&gt;
  &lt;/div&gt;&lt;!-- # Page End --&gt;
  
  &lt;/div&gt;&lt;!-- # Wrapper End --&gt;
  &lt;?php echo Modules::run('admin/common/footer/index');?&gt;
  </code></pre>