add trigger_htmx_event(...) methods to FunctionBase
This commit is contained in:
@@ -1124,6 +1124,36 @@ void FunctionBase::redirect_if_needed(bool was_url_changed)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FunctionBase::trigger_htmx_event(const wchar_t * event_name, bool value)
|
||||||
|
{
|
||||||
|
if( cur->request->is_htmx_request )
|
||||||
|
{
|
||||||
|
pt::Space & trigger = cur->request->out_headers.get_add_space(L"HX-Trigger");
|
||||||
|
trigger.add(event_name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FunctionBase::trigger_htmx_event(const wchar_t * event_name, int value)
|
||||||
|
{
|
||||||
|
if( cur->request->is_htmx_request )
|
||||||
|
{
|
||||||
|
pt::Space & trigger = cur->request->out_headers.get_add_space(L"HX-Trigger");
|
||||||
|
trigger.add(event_name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FunctionBase::trigger_htmx_event(const wchar_t * event_name, long value)
|
||||||
|
{
|
||||||
|
if( cur->request->is_htmx_request )
|
||||||
|
{
|
||||||
|
pt::Space & trigger = cur->request->out_headers.get_add_space(L"HX-Trigger");
|
||||||
|
trigger.add(event_name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DEPRACATED
|
* DEPRACATED
|
||||||
* for backward compatibility
|
* for backward compatibility
|
||||||
|
@@ -239,6 +239,11 @@ public:
|
|||||||
|
|
||||||
virtual void redirect_if_needed(bool was_url_changed = false);
|
virtual void redirect_if_needed(bool was_url_changed = false);
|
||||||
|
|
||||||
|
virtual void trigger_htmx_event(const wchar_t * event_name, bool value);
|
||||||
|
virtual void trigger_htmx_event(const wchar_t * event_name, int value);
|
||||||
|
virtual void trigger_htmx_event(const wchar_t * event_name, long value);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DEPRECATED
|
* DEPRECATED
|
||||||
|
Reference in New Issue
Block a user