- Posts: 42
- Thank you received: 0
New Class
- Sebastian Hoffmann
- Topic Author
- Offline
- Senior Member
Less
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
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.
- Tuan Pham Ngoc
- Offline
- Administrator
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
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
Less
More
- Posts: 42
- Thank you received: 0
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
Best regards
S. Hoffmann
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
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
Tuan
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2024 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.