Get value in activeTextField


From my first input page to second page, I want to get value from first page, like in my first page I pass input value (name), when submit then come to second page and get the name value in activeTextField area, here is my first page

<?php echo CHtml::activeTextField($form,‘name’); ?>

Howt to pass the name value to second page in activeTextField section

second page should be this way

<?php echo CHtml::activeTextField($form,‘name’); ?>

this is not working

<?php echo CHtml::activeTextField($form,$_GET[name]); ?>

can you tell me how I get the value?

It all depends on how do you get to the second page… do yo uuse some ajax to get from first page to the second… or you post the first page to a controller and then you render the second ?

I want to post value to the second page in activeTextField, user can change if he wants.

can you tell me with example?


Sorry but I don’t understand what you want to accomplish… post value directly to second view… and what you mean with user can change if he wants…

you need to get at least the basic knowledge of MVC and how Yii works…

every time a form is submited it goes through a controller - model - view…

in the end you need to show me an example… do you already have some code or this is just an idea you want to produce

first view page

<?php echo CHtml::activeTextField($form,‘name’); ?>






second view page

<?php echo CHtml::activeTextField($form,’[color="#FF0000"]I need first page value in here[/color]’); ?>

As I wrote above you need the basic understanding of how Yii works…

In your controller

if( &#036;form-&gt;validate() ) -- what is &#036;form... a model can validate not a form...

Here in the controller you get all the values from the first view… and then just send that values to the second view…


if you use redirect… than you need to send that value as a URL parameter… and in the controller for the second page… read that value and send to the second view

in there any way to get value like this in yii

<input type=text name=name value=<?php echo $_GET[name]; ?>>