Adding variable to custom get public function #80

Closed
opened 2017-05-09 03:22:12 +00:00 by mwweb · 1 comment
mwweb commented 2017-05-09 03:22:12 +00:00 (Migrated from github.com)

I'm trying to figure this one out in JCB...

Currently, I have a custom get which creates the following public function:

public function getImage()

I need to be able to add a variable in the (). In the code itself I could manually add it, but is there a way in JCB to get the public function as:

public function getImages($property_id)

I'm trying to figure this one out in JCB... Currently, I have a custom get which creates the following public function: public function getImage() I need to be able to add a variable in the (). In the code itself I could manually add it, but is there a way in JCB to get the public function as: public function getImages($property_id)

At this point the Joomla get method in the view does not allow for a signature method (method that takes values)

So you will get the result of that method in the view with $this->get('Images'); and so you can pass values to the method. So the best way is to use class values, if you have a value in one method that you need in another, set it to a class value like this $this->property_id = $property_id; this way you can get the value without passing it to the method.

At this point the Joomla get method in the view does not allow for a signature method (method that takes values) So you will get the result of that method in the view with `$this->get('Images'); ` and so you can pass values to the method. So the best way is to use class values, if you have a value in one method that you need in another, set it to a class value like this `$this->property_id = $property_id;` this way you can get the value without passing it to the method.
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#80
No description provided.