Problem with CHTML::button and $_GET

Newbie here. CHTML::Button adding many characters. I can’t figure it out.

I am trying to pass the portfolio_id to another form. Once a user selects a portfolio, the button should take him to another form (another model/controller) to input child records. Portfolio_id then becomes foreign key in the other table and should prepopulate the model with that value. But on click, i thought i would get:

url…blablabla/ id=2

but, this is what i get as a url:

url… /create?0%5Bid%5D=2

added characters and percent signs. $_GET does not pick it up. I get an undefined index error.

Database tables:

Portfolio (id, name, desc) and project (id, name, desc, portfolio_id). relationship - a portfolio may contain many projects. Project can only be associated with one project.

My portfolio form code:

<h1>View Portfolio <?php echo $model->name; ?></h1>

<?php $this->widget(‘zii.widgets.CDetailView’, array(








)); ?>

<?php echo CHtml::Button(‘Add Projects to Portfolio’, array(‘submit’ => array(‘projectPortfolio/create’, array(‘id’=>$this->id))));?>

<?php print_r($_GET[‘id’]);?>

project controller

if (isset($GET[‘portfolioId’]))


What am i missing here?

I think it should be:

array('projectPortfolio/create', 'id'=>$this->id) // no additional arrays there