Skip to content

PlusMagi's Blog By Pitt Phunsanit

Plus emotional magic to the knowledge of logic.

  • About’s Pitt
Close Button

บังคับให้ user loginบังคับให้ user login

2013-01-192013-01-19| phunsanitphunsanit| 0 Comment | 07:00

ใน yii2 สามารถบังคับให้ผู้เข้าเยี่ยมชม ต้องล๊อกอินทุกครั้ง ในทุกหน้าของเว็บหรือ site นั้น ๆ (backend / frontend) โดยเข้าไปที่ site/config/main.php แล้วเพิ่มเข้าไปใน components ตามตัวอย่าง
‘components’ => [
… ‘as beforeRequest’ => [ /* fource login */ ‘class’ => ‘yii\filters\AccessControl’, ‘rules’ => [ [ ‘actions’ => [‘login’, ‘error’], ‘allow’ => true, ], [ ‘allow’ => true, ‘roles’ => [‘@’], ], ], ],
…
]
[/code]

ถ้าใส่ใน common/config.php จะมี error
Read MoreRead More

Posts pagination

ก่อนหน้า 1 … 754 755 756 … 980 ถัดไป

Projects

  • Statement Columns Mapping Helper
  • PlusMagi Site Search
  • jQuery Plus Repeater

Recent Posts

  • AI:thClaws
  • Laravel: php artisan tinker
  • Line: API มันทำอะไรได้บ้าง
  • Laravel: reset password
  • AWS S3 คืออะไร ? คู่มือครบจบสำหรับผู้เริ่มต้น

Archives

Categories

  • AI (10)
  • Businesses (4)
  • Design (37)
    • UX/UI (6)
  • DevOps (55)
    • CI/CD (2)
    • Docker (29)
    • GIT (25)
  • Histories (10)
  • Life (75)
    • Books (28)
    • Tips and Tricks (15)
    • พุทธ (5)
  • Network (115)
    • Apache HTTP Server (13)
    • IOT (1)
    • Nginx (27)
    • Stalwart (5)
  • Operating Systems (243)
    • Unix-like (172)
      • Android (13)
      • iPhone (5)
      • Linux (107)
      • macOS (85)
        • Homebrew (15)
        • OrbStack (10)
      • Oh My ZSH (4)
      • Shell Script (32)
      • SSH (11)
    • Windows (111)
      • PowerShell (23)
      • WSL (24)
  • Programming (652)
    • .NET (18)
      • .NET Core EF (5)
      • C# (17)
    • API (21)
      • REST (5)
      • Swagger (6)
    • Database (173)
      • DBeaver (3)
      • MariaDB (26)
      • MySql (64)
      • Oracle Database (5)
        • 10g (2)
      • PostgreSQL (6)
      • RDBMS (1)
      • SQL Server (84)
        • SSMS (8)
        • T-SQL (26)
      • SQLite (1)
    • PowerBuilder (10)
    • Python (1)
    • Rust (1)
    • System Analyst (SA) (3)
    • Testing (11)
      • Automated Testing (3)
        • Playwright (2)
    • UML (2)
    • Web (343)
      • Backend (218)
        • Golang (1)
        • Java (44)
          • Spring Boot (14)
        • Node.js (1)
        • PHP (173)
          • Laravel (16)
          • Yii (5)
      • Frontend (123)
        • CSS (17)
          • Tailwind CSS (5)
        • JavaScript (111)
          • Angular (2)
          • jQuery (60)
          • Tabulator (11)
          • Vue.js (3)
      • WordPress (25)
  • Programs (73)
    • Excel (10)
  • Security (47)
  • กฎหมาย (6)

Sirat WordPress Theme By VWThemes

Scroll Up