title: Yii display multiple Child elements as links in a CGridView Field
body: <p>I have the following table:</p>
  
  <pre><code>CREATE TABLE "place" (
      "id" int8 NOT NULL DEFAULT nextval('place_id_seq'::regclass),
      "name" varchar(128) NOT NULL,
      "parent" int8,
      "description" varchar(100)
  )
  WITH (OIDS=FALSE);
  </code></pre>
  
  <p>(It's PostgreSQL but this shouldn't be relevant here)</p>
  
  <p>I created the CRUD through giix and changed a bit the relations to match my needs. So I ended up with:</p>
  
  <pre><code>public function relations() {
      return array(
          'parent0' =&gt; array(self::BELONGS_TO, 'Places', 'parent'),
          'places' =&gt; array(self::HAS_MANY, 'Places', 'parent'),
      );
  }
  </code></pre>
  
  <p>The goal here is that a place can belong to another place and have multiple children places.</p>
  
  <p>My problem is that I need to change the admin action to match the following grid:
  <img src="https://i.stack.imgur.com/qAevP.png" alt="Print manipulated by the inspector to reflect the desired behaviour"></p>
  
  <p>Print manipulated by the inspector to reflect the desired behaviour</p>
  
  <p>So my problem is to get the list of all the children objects and display it as a list of links. I tried change the respective admin.php view file for:</p>
  
  <pre><code>$this-&gt;widget('zii.widgets.grid.CGridView', array(
      'id' =&gt; 'places-grid',
      'dataProvider' =&gt; new CActiveDataProvider('Places', array('id'=&gt;$model-&gt;places)),
      'filter' =&gt; $model,
      'columns' =&gt; array(
          array(
                  'name'=&gt;'parent',
                  'value'=&gt;'GxHtml::valueEx($data-&gt;parent0)',
                  'filter'=&gt;GxHtml::listDataEx(Places::model()-&gt;findAllAttributes(null, true)),
                  ),
          'name',
          'places',
          array(
              'class' =&gt; 'CButtonColumn',
          ),
      ),
  ));
  </code></pre>
  
  <p>But this, as expected, throughs an error:</p>
  
  <blockquote>
    <p>htmlspecialchars() expects parameter 1 to be string, array given</p>
  </blockquote>
  
  <p>Also I don't know this would even work with the built in avanced search.</p>
  
  <p>Could anyone kindly point me into the correct direction here?</p>