Welcome Guest, Not a member yet? Register   Sign In
Search Results
    Thread: Routes: Which style is "better"?
Post: RE: Routes: Which style is "better"?

@demyr and @InsiteFX - I agree and pretty much do the single get/post as well, this was just a quick example to show off the difference in the URL handling. Which method do you use for that? The expli...
1,058 Views
8 Replies
12-28-2023, 07:33 AM
SoccerGuy3
    Thread: Routes: Which style is "better"?
Post: Routes: Which style is "better"?

Since explicit routing became the recommendation a while back, I have wondered about the style of the route. Is there a "best practice"? Or is just developer preference? Running CI 4.3.3 if it matter...
1,058 Views
8 Replies
12-27-2023, 11:55 AM
SoccerGuy3
    Thread: Setting 404 Status Code
Post: RE: Setting 404 Status Code

Leo Wrote: (10-05-2023, 12:03 AM) -- THANK YOU! I finally got a correct 404 response (it used to be 200 and my SEO guy was complaining about it) Here is the code in app\Config\Routes.php (CodeIgnite...
2,567 Views
5 Replies
10-13-2023, 08:11 AM
SoccerGuy3
    Thread: Setting 404 Status Code
Post: Setting 404 Status Code

Recently discovered that my 404 override was throwing errors silently into the logs in production. Trying to troubleshoot it this morning.  This is my code in the app/Config/Routes.php file: PH...
2,567 Views
5 Replies
06-22-2023, 07:46 AM
SoccerGuy3
    Thread: DB Insert Timing
Post: RE: DB Insert Timing

kenjis Wrote: (01-18-2023, 06:04 PM) -- $useTimestamps is a property in Model. See https://codeigniter4.github.io/CodeIgniter4/models/model.html#configuring-your-model I recommend you read the us...
2,750 Views
11 Replies
01-27-2023, 11:02 AM
SoccerGuy3
    Thread: DB Insert Timing
Post: RE: DB Insert Timing

kenjis Wrote: (01-17-2023, 06:37 PM) -- The $useTimestamps is false by default. https://codeigniter4.github.io/CodeIgniter4/models/model.html#usetimestamps If it is false, CI Model does not set the...
2,750 Views
11 Replies
01-18-2023, 07:33 AM
SoccerGuy3
    Thread: DB Insert Timing
Post: RE: DB Insert Timing

kenjis Wrote: (01-16-2023, 09:03 PM) -- Check your real SQL statements with Debug Toolbar or DB Server log. -- Code: -- INSERT INTO `auction_lots_versions` (`parent_id`, `created_at`, `createdby_i...
2,750 Views
11 Replies
01-17-2023, 10:58 AM
SoccerGuy3
    Thread: DB Insert Timing
Post: RE: DB Insert Timing

kenjis Wrote: (01-16-2023, 05:20 PM) -- How do you set the  created_at value? Using Model $useTimestamps? https://codeigniter4.github.io/CodeIgniter4/models/model.html#usetimestamps -- No, I let...
2,750 Views
11 Replies
01-16-2023, 05:26 PM
SoccerGuy3
    Thread: DB Insert Timing
Post: RE: DB Insert Timing

kenjis Wrote: (01-16-2023, 04:49 PM) -- Can you show minimum sample code? -- Sure. Here it is (I cut out a bunch of stuff that isn't relative - the code works, it is just the time stamp I am questio...
2,750 Views
11 Replies
01-16-2023, 04:59 PM
SoccerGuy3
    Thread: DB Insert Timing
Post: DB Insert Timing

Ran into something strange today. Running CI4.2.11 with PHP 8.025 I have a process setup that takes some input, does an insert into the database, opens a dialog box which is a confirmation, takes tha...
2,750 Views
11 Replies
01-16-2023, 03:59 PM
SoccerGuy3
    Thread: Table short name and queries
Post: RE: Table short name and queries

kenjis Wrote: (11-10-2022, 06:42 PM) -- See https://codeigniter4.github.io/CodeIgniter4/database/query_builder.html#CodeIgniter\Database\BaseBuilder::from -- Thanks. Not sure how I managed to miss ...
3,465 Views
12 Replies
11-11-2022, 07:18 AM
SoccerGuy3
    Thread: Table short name and queries
Post: RE: Table short name and queries

kenjis Wrote: (11-09-2022, 12:37 AM) -- I found tips to get QueryBuilder from the Model: https://github.com/codeigniter4/CodeIgniter4/issues/4527#issuecomment-869103637 -- Ok, that seems to "fix" ...
3,465 Views
12 Replies
11-10-2022, 08:56 AM
SoccerGuy3
    Thread: Table short name and queries
Post: RE: Table short name and queries

davis.lasis Wrote: (11-09-2022, 12:30 AM) -- As far as i can see (without testing my-self), you have a syntax error in your example code. You have `n` not `news` and order_by must have those tables ...
3,465 Views
12 Replies
11-09-2022, 05:25 PM
SoccerGuy3
    Thread: Table short name and queries
Post: RE: Table short name and queries

kenjis Wrote: (11-08-2022, 04:46 PM) -- It is not a super easy query. I don't know how to properly write it in Model. If you really like to use an alias, it seems better to extend Model to add $a...
3,465 Views
12 Replies
11-08-2022, 04:50 PM
SoccerGuy3
    Thread: Table short name and queries
Post: RE: Table short name and queries

kenjis Wrote: (11-07-2022, 06:00 PM) -- Query Builder can use alias (short name). https://codeigniter4.github.io/CodeIgniter4/database/query_builder.html PHP Code: -- $db      = \Config\Database...
3,465 Views
12 Replies
11-08-2022, 09:49 AM
SoccerGuy3
    Thread: Table short name and queries
Post: RE: Table short name and queries

kenjis Wrote: (11-07-2022, 04:53 PM) -- You cannot use short name in $table. $table is a table name. 'mailing_suggestedchanges msc' is not a table name. You are confusing the Model and QueryBui...
3,465 Views
12 Replies
11-07-2022, 05:36 PM
SoccerGuy3
    Thread: Table short name and queries
Post: Table short name and queries

Hey all. Using CI 4.2.6 and having some issues with trying to use a table short name in my queries. In my model if I put: PHP Code: -- protected $table = 'mailing_suggestedchanges msc'; -- And do...
3,465 Views
12 Replies
11-07-2022, 04:37 PM
SoccerGuy3
    Thread: How Cancel The Delete in ‘’$useSoftDeletes = true‘’
Post: RE: How Cancel The Delete in ‘’$useSoftDeletes = t...

ozornick Wrote: (07-27-2022, 11:28 PM) -- Yesterday I ran into this situation. If you set the entity $user->deletedAt = null, it may not be able to update the entry. It says "No data to update" The ...
1,437 Views
4 Replies
10-14-2022, 08:14 AM
SoccerGuy3
    Thread: Post Update Compare Script
Post: RE: Post Update Compare Script

Thanks. The Liaison ( https://github.com/paulbalandan/liaison-revision ) sounds like the right one (or at least the closest to what I remember. The one I remember just created backups for the files in...
855 Views
2 Replies
09-13-2022, 06:32 AM
SoccerGuy3
    Thread: Post Update Compare Script
Post: Post Update Compare Script

Hey all,  A while back I came across a script that could be run against a CI update (via composer) and it would compare the files that changed against the old files (like the files in App >> Config) ...
855 Views
2 Replies
09-12-2022, 02:49 PM
SoccerGuy3

Theme © iAndrew 2016 - Forum software by © MyBB