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 … 788 789 790 … 1,023 ถัดไป

Projects

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

Recent Posts

  • AI MCP: Model Context Protocol
  • React: TabulatorPlus
  • SonarQube: ติดตั้ง
  • Tabulator: TabulatorPlus (Wrapper Class )
  • AI:thClaws

Archives

Categories

  • AI (15)
  • Businesses (4)
  • Design (43)
    • UX/UI (12)
  • DevOps (59)
    • CI/CD (2)
    • Docker (32)
    • GIT (25)
  • Histories (10)
  • Life (81)
    • Books (28)
    • Tips and Tricks (21)
    • พุทธ (5)
  • Network (119)
    • Apache HTTP Server (14)
    • IOT (1)
    • Nginx (28)
    • Stalwart (5)
  • Operating Systems (255)
    • Unix-like (183)
      • Android (15)
        • F-Droid (5)
      • iPhone (8)
      • Linux (112)
      • macOS (96)
        • Homebrew (15)
        • OrbStack (11)
      • Oh My ZSH (4)
      • Shell Script (33)
      • SSH (11)
    • Windows (116)
      • PowerShell (24)
      • WSL (24)
  • Programming (686)
    • .NET (18)
      • .NET Core EF (5)
      • C# (17)
    • API (25)
      • REST (5)
      • Swagger (6)
    • Database (176)
      • DBeaver (3)
      • MariaDB (28)
      • MySql (66)
      • Oracle Database (6)
        • 10g (3)
      • PostgreSQL (8)
      • RDBMS (2)
      • SQL Server (85)
        • SSMS (8)
        • T-SQL (26)
      • SQLite (1)
    • PowerBuilder (10)
    • Python (1)
    • Rust (1)
    • System Analyst (SA) (8)
    • Testing (15)
      • Automated Testing (7)
        • Playwright (5)
    • UML (7)
    • Web (367)
      • Backend (238)
        • Golang (1)
        • Java (45)
          • Spring Boot (14)
        • Node.js (1)
        • PHP (192)
          • Laravel (16)
          • Yii (5)
      • Frontend (125)
        • CSS (17)
          • Tailwind CSS (5)
        • JavaScript (113)
          • Angular (2)
          • jQuery (60)
          • Tabulator (13)
          • Vue.js (4)
      • WordPress (25)
  • Programs (83)
    • Excel (10)
  • Security (52)
  • Uncategorized (1)
  • กฎหมาย (6)

Sirat WordPress Theme By VWThemes

Scroll Up