Hi Alex! Thanks for this video series, it's a huge help! I wish you'd zoom in a lot more during the videos though, the text is small and very very hard to see sometimes
23:31 "Deletes are not allowed unless they contain a "where" or "like" clause". When I exchange find with where it doesn't really delete my entry. It just deletes post_id but not the hole row. What am I missing?
Hey Alex, ive been having a lot of problems when using $this->where(['id' => $id])->first(); and all of these variants, i might get something like a getUserName function to work on one view but then the next time i need it I might get an array error or something similar, im getting exhausted, oh and also some object errors :S
hi i saw u have created a snippet 'ou' for '' . I made one too cause i find it very usefull, but whenever i try to use it between double quotes it does not see the snippet. I see it works for you, so can you please tell me how you did it?
Muchas gracias por tu curso. Me gustaría que pudieras reducir la resolución de tu pantalla para que el espectador pueda tener una mejor visión del código. Saludos
Hi Alex thank you for the awesome content, I got this error, please let me know what wrong I've done. "message": "You must use the \"set\" method to update an entry.",
Hey Alex. I'm having an issue when I'm deleting a post. The post gets deleted, but the redirection adds the port :8080 to the url and thus get me the "This site can't be reached" error. I have the exact same code as you do. I don't know if there's a way to prevents the port :8080 to be added to the url? Great tutorials by the way!
Hi Alex, Can you please make an indeth video on how to create core system classes in CI4 and an advanced tutorial on how to extend controllers (eg: My_controller.php, Public_controller.php, Admin_controller.php, etc...) ? I have a project in CI3 which I would like to migrate in CI4. But I see things changed completely in CI4.
Hello Alex, for join queries, (eg: display a list of blogpost title, with the name of the post_category they belong to) Many table have the same column field name (post>title, category>title, sector>title) and when joining them, this create problems. Is the only solution to create unique fieldnames in every table ? (eg: posts>post_title; categories>category_title, ...) there is no cleaner ways? Thank you!
A 'cleaner' way would be to use SELECT posts.title as post_title, categories.title as category_title......and so on but for large tables with multiple similar columns it is an issue. That's the reason why i always use prefixes.
Dear Alex, Can you show how to do form and search query? I believe from view - form action passes to controller and then to model and bring back to search result page. can you show am example? appreciate
@@JeewakaKarunaratne upload your code somewhere to show me, I don;t understand what exactly you want me to show. If it is a POST form the use in your controller $this->request->getPost('field_name')
Thank you Alex You are doing a great work...I have subscribed your channel...want a small help...I am using Visual Studio Version: 1.46.1 (user setup) but whenever I am typing a function VS is not showing as many options as it is showing in your video...it is showing mostly php functions but not the codeIgniter functions...you must have enabled some functions in VS..please can you tell me which option??? or can you make a small tutorial how to use VS for CodeIgniter..it may help new users like me...
You can use Query builder class. But some times you don't want to tie you Model to a specific Table (as 'Base Model' class requires.). Therefore, when you want to have more freedom you should use Custom Model
Stay with Laravel is better syntax, bigger community, loads resources out there, and one of the hotest backend framework with loads functionalities and build-in capabilities, codeigniter is a bit outdated these days and not much you can do, nice to have it but not much, I would highly recommended Laravel and Symfony.
BlogModel extends Codeigniter's core model class, therefore you have access to some methods right away (findAll, save(), insert()), but you also have to define some properties to that class such as: $table, $allowedFields, $primaryKy etc.. So BlogModel is tight to one table in your database. Now, if you want more flexibility, similar to Ci3, you create a Model that does not extend any other classes, it is on it's own, and there you can create any table related rules, perform multiple joins and generally be more free to do your own logic.
sir plez.. apload a video for Image Manipulation Class in codeigniter 4.0.3 as soon as posible my project aswell as complete i had only one proble with image compression plez.. help me sir hope you do thanks in advance
I had this "CodeIgniter\Database\Exceptions\DatabaseException #8 - Unable to connect to the database" error on spark server. The following solution worked for me, maybe somebody benefit from it too. Btw I don't know if this solution is safe for production. Change the "database.default.hostname" from "localhost" to "127.0.0.1" on .env file; database.default.hostname = 127.0.0.1 and Change the mod of writable folder to 777. Open the terminal on project folder; chmod 777 -R writable
Recording yourself in a programming video is completely useless effort, please focus on the program when you are recording a program. Besides all of these, your programming skills are awesome. I learned a lot from your videos.
just got started with MVC and CodeIgniter, I have to admit this has been very helpful. Thank you so much.
Keep them coming. These tutorials have been a great help. Thanks Alex.
I am very glad to hear that.
A modern option to create a model is use spark
>php spark make:model Blog
Spark create model with all the code
Hi Alex! Thanks for this video series, it's a huge help!
I wish you'd zoom in a lot more during the videos though, the text is small and very very hard to see sometimes
Got you, Samuel!
Hi Alex, Great tutorials in this series! What extensions do you have installed for your snippets in Visual Studio?
What is the extension that you used to comment on multiple lines at 03:21. Thanks in advance
ctrl+/
23:31 "Deletes are not allowed unless they contain a "where" or "like" clause". When I exchange find with where it doesn't really delete my entry. It just deletes post_id but not the hole row. What am I missing?
Ok, got it. Didn't set AI onto post_id. Code works now. But why does it make such a big difference in terms of using Db commands?
Hey Alex, ive been having a lot of problems when using $this->where(['id' => $id])->first(); and all of these variants, i might get something like a getUserName function to work on one view but then the next time i need it I might get an array error or something similar, im getting exhausted, oh and also some object errors :S
hi i saw u have created a snippet 'ou' for '' . I made one too cause i find it very usefull, but whenever i try to use it between double quotes it does not see the snippet. I see it works for you, so can you please tell me how you did it?
Muchas gracias por tu curso. Me gustaría que pudieras reducir la resolución de tu pantalla para que el espectador pueda tener una mejor visión del código. Saludos
Did they pay you at all for this series? It's really good at 1.25x speed
Perfect, thanks for your work!
how can I check if record are not exist before record to database ?
Really helpful tutorial . Thank you so much Alex
Hi Alex thank you for the awesome content,
I got this error, please let me know what wrong I've done.
"message": "You must use the \"set\" method to update an entry.",
Here is the complete error content.
{
"title": "CodeIgniter\\Database\\Exceptions\\DatabaseException",
"type": "CodeIgniter\\Database\\Exceptions\\DatabaseException",
"code": 500,
"message": "You must use the \"set\" method to update an entry.",
"file": "/home/keju66pioihx/public_html/bds/public_html/system/Database/BaseBuilder.php",
"line": 2278,
"trace": [{
"file": "/home/keju66pioihx/public_html/bds/public_html/system/Database/BaseBuilder.php",
"line": 2234,
"function": "validateInsert",
"class": "CodeIgniter\\Database\\BaseBuilder",
"type": "->",
"args": []
},
{
"file": "/home/keju66pioihx/public_html/bds/public_html/system/Model.php",
"line": 755,
"function": "insert",
"class": "CodeIgniter\\Database\\BaseBuilder",
"type": "->",
"args": []
},
{
"file": "/home/keju66pioihx/public_html/bds/public_html/system/Model.php",
"line": 574,
"function": "insert",
"class": "CodeIgniter\\Model",
"type": "->",
"args": [
[],
false
]
},
{
"file": "/home/keju66pioihx/public_html/bds/public_html/app/Controllers/Home.php",
"line": 62,
"function": "save",
"class": "CodeIgniter\\Model",
"type": "->",
"args": [{
"name": "ankesh",
"mobile": "4856734653",
"aadhar": "86786576655656",
"village": "village",
"gram_panchayat": "gram_panchayat",
"tahseel": "tahseel",
"district": "district",
"state": "state",
"pincode": "pincode",
"gender": "gender",
"email": "email",
"category": "category"
}]
},
{
"file": "/home/keju66pioihx/public_html/bds/public_html/system/CodeIgniter.php",
"line": 918,
"function": "add_update_beneficiary",
"class": "App\\Controllers\\Home",
"type": "->",
"args": []
},
{
"file": "/home/keju66pioihx/public_html/bds/public_html/system/CodeIgniter.php",
"line": 404,
"function": "runController",
"class": "CodeIgniter\\CodeIgniter",
"type": "->",
"args": [{}]
},
{
"file": "/home/keju66pioihx/public_html/bds/public_html/system/CodeIgniter.php",
"line": 312,
"function": "handleRequest",
"class": "CodeIgniter\\CodeIgniter",
"type": "->",
"args": [
null,
{
"handler": "file",
"backupHandler": "dummy",
"storePath": "/home/keju66pioihx/public_html/bds/public_html/writable/cache/",
"cacheQueryString": false,
"prefix": "",
"memcached": {
"host": "127.0.0.1",
"port": 11211,
"weight": 1,
"raw": false
},
"redis": {
"host": "127.0.0.1",
"password": null,
"port": 6379,
"timeout": 0,
"database": 0
},
"validHandlers": {
"dummy": "CodeIgniter\\Cache\\Handlers\\DummyHandler",
"file": "CodeIgniter\\Cache\\Handlers\\FileHandler",
"memcached": "CodeIgniter\\Cache\\Handlers\\MemcachedHandler",
"predis": "CodeIgniter\\Cache\\Handlers\\PredisHandler",
"redis": "CodeIgniter\\Cache\\Handlers\\RedisHandler",
"wincache": "CodeIgniter\\Cache\\Handlers\\WincacheHandler"
}
},
false
]
},
{
"file": "/home/keju66pioihx/public_html/bds/public_html/index.php",
"line": 45,
"function": "run",
"class": "CodeIgniter\\CodeIgniter",
"type": "->",
"args": []
}
]
}
you update post method varble names which comes from( form)
E.g> post-title change in controller method post_title
Please how can i call a custom function from a model to a view? ..... I want to create a function in my model and call it in my view.
Hey Alex. I'm having an issue when I'm deleting a post. The post gets deleted, but the redirection adds the port :8080 to the url and thus get me the "This site can't be reached" error. I have the exact same code as you do. I don't know if there's a way to prevents the port :8080 to be added to the url? Great tutorials by the way!
How to use Oder by, Joins in Codeighniter 4 Model. Plz help
I can't insert what is problem?
Try CAPS for getMethod() == "POST"
Hi Alex,
Can you please make an indeth video on how to create core system classes in CI4 and an advanced tutorial on how to extend controllers (eg: My_controller.php, Public_controller.php, Admin_controller.php, etc...) ?
I have a project in CI3 which I would like to migrate in CI4.
But I see things changed completely in CI4.
Thankyou my friend, you help me a lot. If you mind. please make a tutorial for build front end and back end technique
I will publish a tutorial on how to create a website with backend later this month hopefully.
@@AlexLancer awesome Thankyou,
Hi Alex,
Could you please help me building a CI 4 ACL library . If there is any reference links would be very great
Thanks in Advance
Nijil
Hello Alex, for join queries, (eg: display a list of blogpost title, with the name of the post_category they belong to)
Many table have the same column field name (post>title, category>title, sector>title) and when joining them, this create problems.
Is the only solution to create unique fieldnames in every table ? (eg: posts>post_title; categories>category_title, ...) there is no cleaner ways?
Thank you!
A 'cleaner' way would be to use SELECT posts.title as post_title, categories.title as category_title......and so on
but for large tables with multiple similar columns it is an issue. That's the reason why i always use prefixes.
hi Alex, can you give code in text rather video?
Dear Alex,
Can you show how to do form and search query?
I believe from view - form action passes to controller and then to model and bring back to search result page. can you show am example?
appreciate
do you mean how to search using query variables in url ?
domain/search?quesry=findsometthing&user_id=54 and so on ?
@@AlexLancer no
I have a form that search accommodation.
Thank you Alex
@@JeewakaKarunaratne upload your code somewhere to show me, I don;t understand what exactly you want me to show.
If it is a POST form the use in your controller $this->request->getPost('field_name')
Thanks for the very useful content!
Glad it was helpful!
Thank you Alex You are doing a great work...I have subscribed your channel...want a small help...I am using Visual Studio Version: 1.46.1 (user setup) but whenever I am typing a function VS is not showing as many options as it is showing in your video...it is showing mostly php functions but not the codeIgniter functions...you must have enabled some functions in VS..please can you tell me which option??? or can you make a small tutorial how to use VS for CodeIgniter..it may help new users like me...
Can’t you use the base model class to manually build a query without creating the custom model?
You can use Query builder class. But some times you don't want to tie you Model to a specific Table (as 'Base Model' class requires.). Therefore, when you want to have more freedom you should use Custom Model
Very Thanks!
Hi alex, why do u prefer Codeigniter over other frameworks of PHP?
Stay with Laravel is better syntax, bigger community, loads resources out there, and one of the hotest backend framework with loads functionalities and build-in capabilities, codeigniter is a bit outdated these days and not much you can do, nice to have it but not much, I would highly recommended Laravel and Symfony.
Sir, you imported "CodeIgniter \ Model" into the BlogModel but not into the CustomModel, will that affect it later? What's the difference?
BlogModel extends Codeigniter's core model class, therefore you have access to some methods right away (findAll, save(), insert()), but you also have to define some properties to that class such as: $table, $allowedFields, $primaryKy etc.. So BlogModel is tight to one table in your database.
Now, if you want more flexibility, similar to Ci3, you create a Model that does not extend any other classes, it is on it's own, and there you can create any table related rules, perform multiple joins and generally be more free to do your own logic.
Very goog job !!!
Nice tutorial
thanks alex
Can I use ci4 for production?
Of course. It is a stable release.
sir plez.. apload a video for Image Manipulation Class in codeigniter 4.0.3 as soon as posible my project aswell as complete
i had only one proble with image compression plez.. help me sir hope you do thanks in advance
Later this week my friend.
@@AlexLancer thanks sir , iam wating for this
I had this "CodeIgniter\Database\Exceptions\DatabaseException #8 - Unable to connect to the database" error on spark server.
The following solution worked for me, maybe somebody benefit from it too. Btw I don't know if this solution is safe for production.
Change the "database.default.hostname" from "localhost" to "127.0.0.1" on .env file;
database.default.hostname = 127.0.0.1
and
Change the mod of writable folder to 777. Open the terminal on project folder;
chmod 777 -R writable
Recording yourself in a programming video is completely useless effort, please focus on the program when you are recording a program. Besides all of these, your programming skills are awesome. I learned a lot from your videos.