I want to show some things on my view using renderPartial and it’s working but I’m having problems with some relation fields.
This is my model:
public function invoiceorders($invoice_no)
{
$invoiceorders = InvoiceOrders::find()->where(['invoice_no' => $invoice_no])->with('job')->asArray()->all();
return $invoiceorders;
}
this is my controller:
$invoiceotherorders = InvoiceOrders::invoiceotherorders($invoice_no);
'content' => $this->renderPartial('invoicepdf', array('invoiceorders'=>$invoiceorders
), true),
and it’s working perfect. On my view I can get all the objects under the Job model but one of the objects like pickup_location has another relation to the location table. How can I get access to that? Because right now the pickup_location contains only the ID and I need to get the name of the location.
Let me know if makes sense.