How to use data from model in php

How to use model data in PHP.

Overview

The issue is not knowing how to access data from a database model function in PHP.
Use the provided method to retrieve the function data. For reading data, specify the model to get all fields or a single field.

Answered
Connectivity v6
we webcrea 23 Mar, 2017
Hi,

I have function wich get a line from the database under a model, and i want to use data in php...

And how to know php error ?

Thanks
Max_admin Max_admin 23 Mar, 2017
Answer
1 Likes
Hi Chris,

You can get the function data in PHP using this code:

$this->get("function_name");


If this is a "read data" function and its set to return the "first matching record" only then the first line data is:

$this->get("function_name.Model"); // all fields
$this->get("function_name.Model.field"); // single field


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.