What is a Controller ?
Controllers:
The HEART of MVC architecture is Controller, also called as TRAFFIC COP
Each and every request & response is going to handled by Controller Only.
A Controller is a class file, which contains collection of methods and properties.
Controller classes should be saved in app/Controllers folder.
The file must be called ‘Helloworld.php’, with a capital ‘H’. Controller class names MUST start with an uppercase letter and ONLY the first character can be uppercase.
Controller extends the parent controller class so that it can inherit all its methods.
namespace App\Controllers;
use CodeIgniter\Controller;
class Helloworld extends Controller
{
public function index()
{
echo 'Hello World!';
}
}
In questa pagina del sito puoi guardare il video online #07 Controllers in CodeIgniter 4 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato GoPHP 19 giugno 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 24,380 volte e gli è piaciuto 209 spettatori. Buona visione!