Yii2 data attributes handled by the framework

So, if there is a need to place a link somewhere in some template, and want it work by post method, i just add a data-method = 'post' attribute. If i want to send some parameters, then just add data-params-param1 = "param1Value" attribute. If i need a confirmation before this link work - add data-confirm = "Some comfirmation message" attribute. The question is: what other data-* attributes i can use when developing with Yii2, or where i can find information. I have tried to google, look in Yii2 api - no results.

Upvotes: 3

Views: 520

Answers (1)

Bizley
Bizley

Reputation: 18021

AFAIK there is no documentation for this at the moment. It's only mentioned in few places.

Based on the current yii.js, yii,captcha.js, and yii.gridView.js these data-* are specially handled:

  • form
  • method
  • params
  • pjax
  • pjax-push-state
  • pjax-replace-state
  • pjax-timeout
  • pjax-scrollto
  • pjax-push-redirect
  • pjax-replace-redirect
  • pjax-skip-outer-containers
  • pjax-container
  • yiiActiveForm
  • yiiSubmitFinalizePromise
  • yiiCaptcha
  • key

Upvotes: 3

Related Questions