New Class

  • Sebastian Hoffmann
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 7 months ago #86387 by Sebastian Hoffmann
New Class was created by Sebastian Hoffmann
Hello,
I tried to create a separate class in the helper folder to make it easier to update event booking in the future.
But I can't call a function of my new class (e.g. RatingSystem::getRating()). When I put a new method in the helper.php, it is no problem. How do I initialize the new class?

Best regards
S. Hoffmann

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #86391 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic New Class
The classname must follow a specific rule so that it could be loaded automatically (using PHP auto-loading). It must start with EventbookingHelper, for example, that class must be EventbookingHelperRatingsystem (the name of the file must be ratingsystem.php and it must be placed inside components/com_eventbooking/helper folder)

Tuan
The following user(s) said Thank You: Sebastian Hoffmann

Please Log in or Create an account to join the conversation.

  • Sebastian Hoffmann
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 7 months ago #86402 by Sebastian Hoffmann
Replied by Sebastian Hoffmann on topic New Class
Great it worked. Thank you!

Best regards
S. Hoffmann

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #86420 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic New Class
Great, I'm glad it helps :)

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc