Pasting from a reply to a previous comment... So if you are using the latest version of CI4 any controller after the default controller must use a getIndex(), getPruduct() method... index() and product() don't work anymore. Im only on video 4 so far so I will expect more routing issues later. Also the parameters inside getProduct() must be assigned a default before you can follow along. getProduct($product='whatever', $product_id='huh') can be also be an empty string. And to get to the Home controller by typing localhost/home you need to add a second route rule like $routes->get('home', 'Home::index'); Hope that helps. So far great Tutorials with that work around.
if some personn get an error 404 you can simply add $routes->setAutoRoute('true'); in app/config/routes.php, or if you want to do manually add this route : " $routes->get('/shop', 'Shop::index');" in app/config/routes.php ( /shop is the path 'Shop::index' -> Shop is name of class and index, name of methode and that for product and product id: " $routes->get('shop/product/(:any)/(:num)', 'Shop::product/$1/$2');" CodeIgniter 4 : (:any) = for all type, letter number etc (:num) = just for number /$1/$2 = fort first and seconde prameter, exemple localhost/product/10 = localhost/$1/$2 = ($type, $product_id)
私は日本人のよしと申します。 本当に、素晴らしい動画でした! 今までわからなかったことが、一気に理解できました。 これからもアレックスさんの動画を楽しみにしています。 本当にありがとうございました! I am Japanese. It was a really great video! I was able to understand at once what I didn't understand. I'm looking forward to Alex's videos. I'm really thankful to you!
// If you don't want to define all routes, please use the Auto Routing (Improved). // Set `$autoRoutesImproved` to true in `app/Config/Feature.php` and set the following to true. $routes->setAutoRoute(true);
To those wondering how he navigates text so efficiently: ctrl + left/right arrow key = move the text cursor one word left/right ctrl + shift + left/right arrow key = move the text cursor one word left/right and select all of it
This kinda sounds ridiculous but I got an error message b/c I used a lower case in the use command ("use App\Controllers\BaseController;"). Originally it is writen as a lower case but doesn't work that way. Can you explain why?
Really good video tutorial, i am feeling really comfortable because, i already knew laravel. If I'm not wrong then, structure of CI4 has somehow same as laravel
I'm new to CI and noticing that Controller methods are being cached server-side for some seconds/minutes when i'm making tweaks to our controller. what's a quick easy way to disable caching while working on a controller?
i have a problem executing the new controller, please solve my issue Not Found The requested URL was not found on this server. Apache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/8.0.19 Server at localhost Port 80
As the documentation says: // URI = example.com/users/15/profile // Prints '15' if ($uri->getSegment(1) == 'users') { echo $uri->getSegment(2); } This applies toCodeigniter 4.
Currently, i am using codeigniter 3.11. I have placed my business logic in controller. It's because creating modal is time consuming. I am only developer and Projects Manager set horribly short deadline. I never able to understand the use of model? Is it for security, to absorb database changes or for anything else? Will anyone clarify this?
In general Model-View-Controller system, model is responsible for dealing with database, View project information on computer screen, and controller is dealing with inputs for users. I have only worked with laravel, but model purpose is to make your code easier to maintenance and easier to read. For example if multiple controllers are using same database table, if you set up logic in model file, you won't need to repeat yourself, and changing code will be easier, as you only need to do it on one spot. But if your's project are small, times are short, and you don't care about the next guy who will have to do maintenance, carry on as you have done so far.
@@sonalsahu909 unfortunately (or fortunately) I don't work with Angular. In near future I plan on making a project with VueJS and CodeIgniter 4 that I will publish on my UA-cam channel.
You are really good at explaining the concepts but it doesn't correspond to the current version of codeIgniter. But for real you're really good at explaining😃
So if you are using the latest version of CI4 any controller after the default controller must use a getIndex(), getPruduct()... also the parameters inside getProduct() must be assigned. getProduct($product='whatever', $product_id='huh') also to get to home by typing localhost/home you need to add a second route rule like $routes->get('home', 'Home::index'); Ive had to stop and start and replay the vids so much I'm only on video 5.
auto route is by default disabled. If you don't want to define all routes, please use the Auto Routing (Improved). Set `$autoRoutesImproved` to true in `app/Config/Feature.php` and in Routes.php set the $routes->setAutoRoute(true)
Pasting from a reply to a previous comment... So if you are using the latest version of CI4 any controller after the default controller must use a getIndex(), getPruduct() method... index() and product() don't work anymore. Im only on video 4 so far so I will expect more routing issues later. Also the parameters inside getProduct() must be assigned a default before you can follow along. getProduct($product='whatever', $product_id='huh') can be also be an empty string. And to get to the Home controller by typing localhost/home you need to add a second route rule like $routes->get('home', 'Home::index'); Hope that helps. So far great Tutorials with that work around.
bro you just saved me a headache thank you!
if some personn get an error 404 you can simply add $routes->setAutoRoute('true'); in app/config/routes.php,
or if you want to do manually add this route : " $routes->get('/shop', 'Shop::index');" in app/config/routes.php
( /shop is the path 'Shop::index' -> Shop is name of class and index, name of methode
and that for product and product id: " $routes->get('shop/product/(:any)/(:num)', 'Shop::product/$1/$2');"
CodeIgniter 4 :
(:any) = for all type, letter number etc
(:num) = just for number
/$1/$2 = fort first and seconde prameter, exemple localhost/product/10 = localhost/$1/$2 = ($type, $product_id)
how come he doesn't get any errors but we do?
CodeIgniter4 updates @@aliabednar8035
@@aliabednar8035 because it's not exactly the same version, this code : $routes->setAutoRoute('true'); . it's added by default in his version.
@@aliabednar8035 CodeIgniter has removed the AutoRoute for reasons of security, it's better if you add manually like my example above.
thanks man really helped
私は日本人のよしと申します。
本当に、素晴らしい動画でした!
今までわからなかったことが、一気に理解できました。
これからもアレックスさんの動画を楽しみにしています。
本当にありがとうございました!
I am Japanese.
It was a really great video!
I was able to understand at once what I didn't understand.
I'm looking forward to Alex's videos.
I'm really thankful to you!
// If you don't want to define all routes, please use the Auto Routing (Improved).
// Set `$autoRoutesImproved` to true in `app/Config/Feature.php` and set the following to true.
$routes->setAutoRoute(true);
Im a student andwe are now using code igniter in web design. This playlist ist really helpful to gain a first understanding about all this, thanks
please make more projects related to CI4. There is really scarcity of such related topics! im learning a lot from your tutorials! Thanks! 🙏
Great video, very good explanations on how to use controllers, namespaces and referencing them.
It doesn't work on the latest version of CI 4, I think you have to modify the routing.php ?
To those wondering how he navigates text so efficiently:
ctrl + left/right arrow key = move the text cursor one word left/right
ctrl + shift + left/right arrow key = move the text cursor one word left/right and select all of it
try vim :)
Why my Shop controller doesn't work without route?
This kinda sounds ridiculous but I got an error message b/c I used a lower case in the use command ("use App\Controllers\BaseController;"). Originally it is writen as a lower case but doesn't work that way. Can you explain why?
great tutorial, but the font on the address bar of browser is too small its almost impossible to see it
How we are able to initialize $shop = new Shop(); without the use App\Controllers\Shop; in 16:23
Really good video tutorial, i am feeling really comfortable because, i already knew laravel. If I'm not wrong then, structure of CI4 has somehow same as laravel
I'm new to CI and noticing that Controller methods are being cached server-side for some seconds/minutes when i'm making tweaks to our controller. what's a quick easy way to disable caching while working on a controller?
I had to make a Route first in Routes.php. Is that due to a newer version or what?
hi alex when type localhost evething work but when i type home comes with error 404
Any idea how to access Shop.php through .../public/ path if I use WAMP?
i have a problem executing the new controller, please solve my issue Not Found
The requested URL was not found on this server.
Apache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/8.0.19 Server at localhost Port 80
i wish i had view this tutorial 3 years ago. now latest CI4 diffrent. followed along and error. stuck at create controller:shop
Help, only defauilt page is working for me I have uploaded it on the internet and not on localhost only
can we acess the protect function using reverse routing ?
Need guidance on
Libraries
As get_instance
Url - segment
Call libraries class function in View file
It was easier in ci3
Please guide
How to load uri segments in view of Codeigniter 4 , as we do $this->uri->segment() in codeigniter 3
As the documentation says:
// URI = example.com/users/15/profile
// Prints '15'
if ($uri->getSegment(1) == 'users')
{
echo $uri->getSegment(2);
}
This applies toCodeigniter 4.
Thanks a lot for you lessons! Please can you tell me why you use "return view()" instead "echo view()" in documentation for codeigniter 4 use "echo"
Both return the same content, you can use "echo" or "return" to render the views.
How do I autoload libraries? In CI3, it was pretty easy. But in CI4, the documentation says you have to store it in a variable.
Your controllers extend BaseController ?
If so, you can set all the libraries you want to use there.
Great, making it look so easy.
It is! Just follow the vids and you will be able to work with Codeigniter 4 in few hours.
Thank you, much appreciated.
You're welcome!
Great Tutoral Alex!!
Thanks!!
My pleasure!
your videos are very helpful to me thank you
Glad to hear that! It is very inspiring that you find value in my videos!
Currently, i am using codeigniter 3.11. I have placed my business logic in controller. It's because creating modal is time consuming. I am only developer and Projects Manager set horribly short deadline. I never able to understand the use of model? Is it for security, to absorb database changes or for anything else? Will anyone clarify this?
In general Model-View-Controller system, model is responsible for dealing with database, View project information on computer screen, and controller is dealing with inputs for users.
I have only worked with laravel, but model purpose is to make your code easier to maintenance and easier to read. For example if multiple controllers are using same database table, if you set up logic in model file, you won't need to repeat yourself, and changing code will be easier, as you only need to do it on one spot.
But if your's project are small, times are short, and you don't care about the next guy who will have to do maintenance, carry on as you have done so far.
Awesome! Big like!
What extension you use in VSC?
great job! thanks!
Hi bro what do you use to re ord your screen? I use OBS in my laptop but will turn black cause of two video card
Hi, I am using Bandicam. But it is not free. Although in my opinion it is the best.
What are the php extensions u use for VS Code?
Hey, check for "PHP Intelephense"
thanks for this!!
please, give more tutorial videos on CI 4 and cover as much topic you can.
Sonal, will do. Don't forget to subscribe and stay updated! Thanks for watching.
@@AlexLancer hey I'm also a web developer (freelance).can you make videos on Anjular JS with CI4/CI3
@@sonalsahu909 unfortunately (or fortunately) I don't work with Angular. In near future I plan on making a project with VueJS and CodeIgniter 4 that I will publish on my UA-cam channel.
@@AlexLancer ok thanks 😊
nice job!
Gran maestro.... gracias
Very nice
I like this vedos im from Indonesian
Glad you like them!
You are really good at explaining the concepts but it doesn't correspond to the current version of codeIgniter. But for real you're really good at explaining😃
very high resolution.. struggling here with the tutorial
localhost/home = 404 error why?
+1
Hi Alex create another API related video, this video is very helpful
I do not understand how he doesn't get routing errors AT ALL. I had to deal with those the WHOLE way through.
So if you are using the latest version of CI4 any controller after the default controller must use a getIndex(), getPruduct()... also the parameters inside getProduct() must be assigned. getProduct($product='whatever', $product_id='huh') also to get to home by typing localhost/home you need to add a second route rule like $routes->get('home', 'Home::index'); Ive had to stop and start and replay the vids so much I'm only on video 5.
@@cassiereardon9226 I wasn't following along, I watched to learn the basic functionality and googled my way through what I actually wanted to make.
auto route is by default disabled. If you don't want to define all routes, please use the Auto Routing (Improved). Set `$autoRoutesImproved` to true in `app/Config/Feature.php` and in Routes.php set the $routes->setAutoRoute(true)
thanks bro
Welcome
Subscribed!
I like your tutorials, Clear and detailed. But there is one request to you please do not upload @ 60 fps.
30 fps is enough for tutorials.
doesn't work, as many of us already said in the comment section.