Parse Error on Adding PHP Dashboard Methods #23

Closed
opened 2016-08-09 18:25:23 +00:00 by paolavness · 1 comment
paolavness commented 2016-08-09 18:25:23 +00:00 (Migrated from github.com)

Hey there, so I want to add a custom dashboard but am getting an error:

Parse error: syntax error, unexpected '=', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in ../administrator/components/com_gaiaeducationbeta/views/gaiaeducationbeta/view.html.php on line 48

In the above file, the line is this:

$this-> = $this->get('...');

When I comment it out, the dashboard appears with no parse errors.

Thank-you,
Paola

Hey there, so I want to add a custom dashboard but am getting an error: > Parse error: syntax error, unexpected '=', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in ../administrator/components/com_gaiaeducationbeta/views/gaiaeducationbeta/view.html.php on line 48 In the above file, the line is this: > $this-> = $this->get('...'); When I comment it out, the dashboard appears with no parse errors. Thank-you, Paola

Hi Poala

So in the component view under the "script" tab there is a switch to add PHP to the Dashboard Method. When this is set to yes you have two new fields. The first is to add the PHP Dashboard Methods, read the note in the field very carefully. That is what is missing.

If you don't want to add any PHP you still at this time need to add a empty method like this

public function getNothing()
{
    return null;
}

This will fix your error, and not that the method must start with get and have camel case naming like the example above.

To really help you more I would need to see the code... reality is that these features or for adding more tabs to the dashboard not replace it.

Hi Poala So in the component view under the "script" tab there is a switch to add PHP to the Dashboard Method. When this is set to yes you have two new fields. The first is to add the PHP Dashboard Methods, read the note in the field very carefully. That is what is missing. If you don't want to add any PHP you still at this time need to add a empty method like this ``` public function getNothing() { return null; } ``` This will fix your error, and not that the method must start with get and have camel case naming like the example above. To really help you more I would need to see the code... reality is that these features or for adding more tabs to the dashboard not replace it.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#23
No description provided.