I currently get data from my service in the following way:
And the service shows me all the users but only their nopmbres as specific in the route.
Now I would like you to show me a specific data. eg:
link and it will only show me the name of "Jorge"
My service I raise it in the following way The controller:
class AmigosController extends ActiveController { public $ modelClass = 'backend \ models \ Friends'; } ...
The model:
class Friends extends \ yii \ db \ ActiveRecord { / ** * @inheritdoc * / public static function tableName () { return 'friends'; }
/**
* @inheritdoc
*/
public function rules()
{
return [
[['idUsuarioAmigo', 'idUsuarioAgregadoAmigo', 'fechaAltaAmigo', 'estatusAmigo'], 'required'],
[['idUsuarioAmigo', 'idUsuarioAgregadoAmigo'], 'integer'],
[['fechaAltaAmigo'], 'safe'],
[['estatusAmigo'], 'string', 'max' => 20],
[['idUsuarioAgregadoAmigo'], 'exist', 'skipOnError' => true, 'targetClass' => Usuarios::className(), 'targetAttribute' => ['idUsuarioAgregadoAmigo' => 'idUsuario']],
[['idUsuarioAmigo'], 'exist', 'skipOnError' => true, 'targetClass' => Usuarios::className(), 'targetAttribute' => ['idUsuarioAmigo' => 'idUsuario']],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'idAmigo' => Yii::t('app', 'Id Amigo'),
'idUsuarioAmigo' => Yii::t('app', 'Id Usuario Amigo'),
'idUsuarioAgregadoAmigo' => Yii::t('app', 'Id Usuario Agregado Amigo'),
'fechaAltaAmigo' => Yii::t('app', 'Fecha Alta Amigo'),
'estatusAmigo' => Yii::t('app', 'Estatus Amigo'),
];
}