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:
but, this is what i get as a url:
added characters and percent signs. $_GET does not pick it up. I get an undefined index error.
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(
'data'=>$model, 'attributes'=>array( 'id', 'tenant_id', 'name', 'description', ),
<?php echo CHtml::Button(‘Add Projects to Portfolio’, array(‘submit’ => array(‘projectPortfolio/create’, array(‘id’=>$this->id))));?>
What am i missing here?