Tạo UI Type mới

B1. Đăng ký UI type trong bảng abmsco_ws_fieldtype

  • uitype: có kiểu dữ liệu là varchar(30)
  • fieldtype: sẽ là tên để tạo class mới trong thư mục “modules/Abmsco/uitypes”

B2. Tạo file mới.

  • Tạo file php mới trong thư mục “modules/Abmsco/uitypes”
  • Tên file sẽ là tên được lưu ở trường field và viết hoa chữ cái đầu

B3. Tạo class mới

  • Trong file mới vừa tạo, tạo một class mới có tên theo cấu trúc “Abmsco_(fieldtype)_UIType” và kế thừa Abmsco_Base_UIType

GeSHi Error: GeSHi could not find the language php (using path /var/www/html/kb.innocom.vn/wp-content/plugins/wp-synhighlight/geshi/geshi/) (code 2)

 

B4. Tạo file template

Để ý đến hai function bên trên

  • Function getTemplateName() sẽ trả về đường dẫn file template cho màn hình Edit.
  • Function getDetailViewTemplateName()  sẽ trả về đường dẫn file template cho màn hình Detail.

Hai file trên đều được tạo ở đường dẫn “layouts/v7/modules/Abmsco/uitypes

Đến đây đã có thể sử dụng UIType mới còn phần custom cho màn hình quick edit em sẽ update lại

 

 

Leave a Reply

You must be logged in to post a comment.