• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Will we have an alternative for "middleware" in CodeIgniter4?

#1
I'm eager to know if we will have a tool or a struct to give us the power of middleware.

By middleware I mean a tools like we have in Laravel.

It's very common to see is the user logged in or does he have enough permissions or not. If that's ok, execute the requested method but if not, show an error or redirect him to login page.

Thank you
Reply

#2
Since CI is just PHP, you have the option to write your own tools (recommended) or adapt PHP code from other sources to fit your needs (assuming it is free of copyright or for which you have legal permission to use).

I'm not saying "you're on your own" but I want to emphasize the freedom which the CI framework gives you. You are NOT required or limited by pre-written "middleware" which may be bundled with other frameworks. CI is deliberately written to be extensible and NOT bloated with many tools, most of which you may never need or use.

There are abundant resources offered by other CI developers of which you should take advantage.

Reading this forum, you will see many examples of the various tools. There are also a number of books (a HUGE number) on basic PHP and CI coding.

When you get to the point of having specific question on a particular tool, DO feel welcome to post your code and question in this forum. We have some very knowledgeable and patient people who will offer assistance. Please ignore the trolls, they seldom last very long when ignored.
CI 3.1 Linux Mint 18.1 xfce Apache 5.x  Mysql 5.x PHP 5.x PHP 7.x
Remember: Obfuscation is a bad thing.
Clarity is desirable over Brevity every time.
Reply

#3
It's interesting the people that think Laravel features should be the norm. Why not just use Laravel? For me, I've had a few Laravel experiences now, and I keep coming back to CI as my favorite framework. I don't want CIravel, if you know what I'm saying.
Reply

#4
Are you thinking something like https://bcit-ci.github.io/CodeIgniter4/g...lters.html ?

The subject of "middleware" has come up within the council, and disregarding the misuse of the term (at odds with enterprise development interpretation), the way "they" handle it is incompatible with our HTTP request implementation. The notion of request handler chaining is getting a bit of traction, though. All we need is time, lots of it!
Reply

#5
(04-02-2017, 01:40 PM)ciadmin Wrote: Are you thinking something like https://bcit-ci.github.io/CodeIgniter4/g...lters.html ?

The subject of "middleware" has come up within the council, and disregarding the misuse of the term (at odds with enterprise development interpretation), the way "they" handle it is incompatible with our HTTP request implementation. The notion of request handler chaining is getting a bit of traction, though. All we need is time, lots of it!

Perfect. You got it.

That was exactly what I was looking for.

It's clear that I can simply use Laravel like many others, but I thought that CI itself could answer such need (which is really general and not toooo specific).

Anyway I should thank you for your understanding of the new CI4 Smile
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.