2021年12月15日 星期三

Building a web site by Codeigniter 4 (CI4)

    I recently tried to build up a website by Codeigniter4 (known as CI4) and thought it is a pretty good framework.
    There are many tutorials and docs on the internet, so I skipped those things in this article. I'll probably focus on the issues I met during website development. 

Tools list
  • XDebug (Local debug)
  • VS Code with plugin 'PHP Debug' (Editor)
  • XAMPP (Local server)
  • Composer (Codeigniter4 and other comonents)
  • Bootstrap 5 (UI components)
Issues: 
  1. Public tool functions
    I write some tool in the folder 'Helpers' in order to use them accross all the controllers. I'm not sure it is the right way to do that.
  2. Modals in Bootstrap 5
    This is very usefull UI and easy to use except for one condition which is switching between modals. In my case, I need to switch modals according to what stage it is now. Unlikely, the POST data will be cleaned after modal switching. For now, I don't have a solution.
    Instead, I use POST method in very modal and check what stage is now and show the related modal by using javascript.
  3. Authentication check
    I write some authenticaiton check in the folder 'Filters' in order to check if the user has the permission to use the routing (page). In general, it is very convient. But, in some cases, the logic would be complicated if the page has multiple modes. Perhaps, it is due to two type users in my case. One is authenticated by other web site and the other is authenticated by my own web site.
  4. Complex Routing
    I'm still working on organizing the routing strategy. I have amost 50 routing pathes in my route definitions and it is not friendly readable. It is a very minor issue but need to fix it in the future.

沒有留言:

搜尋此網誌