/** * Get the data that is going to be passed to the layout * * @return array */ public function getLayoutData() { // Get the basic field data $data = parent::getLayoutData(); // Load the current username if available. $project = new Crowdfunding\Project(JFactory::getDbo()); $projectTitle = ''; if (is_numeric($this->value)) { $project->load($this->value); $projectTitle = $project->get('title'); } $extraData = array('projectTitle' => $projectTitle); return array_merge($data, $extraData); }