Retrieving data

g’day, I want too display 2 items of data that are already being shown correctly on another page however my code is not working . . . . what might i be missing? thanks

Hi @Luci, welcome to the forum.

Could you show us your code?

I am new to yii

So I have 2 pages

Both are suppose to display the same data

Page 1 that displays the data correctly

–start–

    $result .= "<b><H7><STRONG>LOCATION<BR></H7></STRONG></b>"
                . (!empty($about['location']) ? Yii::$app->params['countries'][$about['location']] : '<i>somewhere on earth</i>') . "";
                $result .= "<br>";

–end–

Pagg 2 that does not display the correct data

–start–

if (strpos($template, '{country}') !== false) {
    $location = $model['confirmed_location'] ? $model['confirmed_location'] : $model['location'];
    $location = isset(Yii::$app->params['countries'][$location]) ? Yii::$app->params['countries'][$location] : "Not selected";
 $replacements['{country}'] = "<b> <mark>Country</mark> </b><br>" . $location . "<br>"; // null check
}

–end–

What data do you set for Yii::$app->params['countries'] in the config?

The config has the correct data however what the issue seems to be is that the country is saving when entered on the form because when I go and check the data on page one it is shown correct however when I go to the other page page 2 it is not shown. I have tried to change confirmed_location to location and to use $about rather than $model but it is not working

What is $about, and what is $model?