public function actionEditdate()
{
ZEND_DEBUG::dump("Edit Date is executed");
}
http://xenforo.com/community/posts/636892/report
http://xenforo.com/community/forums/xenforo-development-discussions.34/
http://xenforo.com/community/threads/how-do-i-create-an-add-on-that-allows-a-user-to-click-a-link-and-call-php-code.59856/edit
http://xenforo.com/community/members/chris-deeming.11388/trophies
Creating a route is usually for new content that not already exists. I would not create a route, you can use the existing route for post as the target of your action is a post item. In that case, you just extend library/ControllerPublic/Post.php
Your function would be actionEditdate. If you have a link <a href="/posts/3343/editdate">Edit Date</a>, this actionEditdate function will be executed. Just insert this code by file edit in library/ControllerPublic/Post.php and enter /posts/3343/editdate in your browser (with a correct post_id).
PHP:public function actionEditdate() { ZEND_DEBUG::dump("Edit Date is executed"); }
That's right... Though I'd suggest using change-date... the action part of the URL is inferred from the action name in the Controller.So if I understand correctly, the URL will be something like:
http://xenforo.com/community/posts/636892/change_date
public function actionChangeDate
{
}
I'm recommend for him not insisting he must uses.Why are you insisting he uses a template hook when they are deprecated?
Could I use Template Modification instead?
No. I said Template_Hook. You can use hook_name: post_public_controls
In Kier's example pictured, his file will be located in:So in Kier's example:
View attachment 56868
The file should be called Class.php and it should be located in:
/library/Andy/ChangeDate/Class.php
In Kier's example pictured, his file will be located in:
library/Dev/ControllerPublic/Member.php
Do you understand how the class names are structured in XenForo?
Can you quote my post for that? I remember that I recommend he using extends ControllerPublic instead using new route If that really it true... I'm so sorry about that.You said he couldn't use a template modification. Seems pretty insistent to me.
Why are you creating Class.php?
That's right... Though I'd suggest using change-date... the action part of the URL is inferred from the action name in the Controller.
So eventually you will be extending the Post controller with the following function:
PHP:public function actionChangeDate { }
And that will be accessible from this URL:
.../posts/636892/change-date
We use essential cookies to make this site work, and optional cookies to enhance your experience.