Welcome Guest, Not a member yet? Register   Sign In
Search Results
    Thread: How to access request in ResourcePresenter?
Post: RE: How to access request in ResourcePresenter?

Thanks. If anyone else is using Visual Studio Code with the PHP Intelephense extension, if you want to get rid of the 'Undefined method' problem, add the following class variable and @var tag to docu...
1,835 Views
6 Replies
11-25-2022, 02:05 AM
rich8374
    Thread: How to access request in ResourcePresenter?
Post: RE: How to access request in ResourcePresenter?

You're right, I've just tried it and I can use it fine.  I use Visual Studo Code as an editor and that was complaining that the getPost method wasn't found, I believed it without testing it. The less...
1,835 Views
6 Replies
11-25-2022, 01:26 AM
rich8374
    Thread: How to access request in ResourcePresenter?
Post: RE: How to access request in ResourcePresenter?

kenjis Wrote: (11-24-2022, 05:42 AM) -- $this->request -- good point, $this->request does exist but I can't call $this->request->getPost() on it, whereas I can when a controller extends BaseControl...
1,835 Views
6 Replies
11-24-2022, 05:53 AM
rich8374
    Thread: How to access request in ResourcePresenter?
Post: How to access request in ResourcePresenter?

I have created a simple ResourcePresenter, here is an example command: php spark make:controller books --restful presenter What is the best practice way of accessing the IncomingRequest class in an...
1,835 Views
6 Replies
11-24-2022, 03:53 AM
rich8374
    Thread: post_system event firing before output sent instead of after
Post: RE: post_system event firing before output sent in...

Thanks for clarifying, do you know how I can get the documentation updated to make it clearer?
855 Views
2 Replies
08-25-2022, 04:46 AM
rich8374
    Thread: post_system event firing before output sent instead of after
Post: post_system event firing before output sent instea...

I'm trying to use a post_system event to do some processing after the output has been sent to the browser. The docs at http://codeigniter.com/user_guide/extending/events.html#event-points say the e...
855 Views
2 Replies
08-25-2022, 03:33 AM
rich8374
    Thread: Remove Session Filehandler message from logs
Post: RE: Remove Session Filehandler message from logs

I'm also having this problem. The .env file sets CI_ENVIRONMENT to production and $threshold is set to the default value of 4 but the following INFO messages are still being logged: INFO - 2022-07-21...
4,507 Views
3 Replies
07-21-2022, 03:00 AM
rich8374
    Thread: REST or AJAX don't want toolbar
Post: RE: REST or AJAX don't want toolbar

Thanks for the pointer, if anyone else is using Postman to test API related things, try adding the header X-Requested-With set to XMLHttpRequest and the toolbar won't be returned.
1,445 Views
3 Replies
04-07-2022, 05:36 AM
rich8374
    Thread: REST or AJAX don't want toolbar
Post: REST or AJAX don't want toolbar

When I'm building RESTful APIs or just methods that are used by AJAX requests I'm finding the debug toolbar is getting in the way by adding a lot of content to the output. I guess I can always change ...
1,445 Views
3 Replies
04-07-2022, 04:43 AM
rich8374
    Thread: How to create a new library and use it with controller?
Post: RE: How to create a new library and use it with co...

In your controller, use Code: -- use App\Libraries\ExampleLibrary; -- above the class and then you can instantiate your library class in a method with Code: -- $exampleLibrary = new ExampleLib...
2,255 Views
2 Replies
12-23-2021, 10:05 AM
rich8374
    Thread: Best Practice - Shared Application Code > Multiple Front Ends
Post: RE: Best Practice - Shared Application Code > Mult...

I suggest Symbolic Links for the app and vendor directories then these folders can be in a central location and usable by all sites but you can still use a unique .env file for each site, that lives i...
4,945 Views
6 Replies
12-01-2021, 05:02 AM
rich8374
    Thread: What CI4-related book would you like?
Post: RE: What CI4-related book would you like?

Here is an idea to include in advanced CodeIgniter. Integrating CodeIgniter with WordPress to create a website that is user friendly for administering content and news but can have sophisticated featu...
20,830 Views
20 Replies
10-26-2021, 08:24 AM
rich8374
    Thread: ResourceController and model->update, is this a bug
Post: ResourceController and model->update, is this a bu...

Hi, I'm getting errors when trying to do a database update in a ResourceController, some ways work and some ways throw errors. Is this a bug? Using CodeIgniter 4.1.4, here is a simplified example, I'...
1,740 Views
2 Replies
10-05-2021, 08:37 AM
rich8374
    Thread: Integration with mailchimp.
Post: RE: Integration with mailchimp.

Try putting MailChimp.php into app/ThirdParty, then in your controller: require APPPATH . 'ThirdParty/MailChimp.php';
4,627 Views
3 Replies
01-14-2020, 08:46 AM
rich8374
    Thread: Array in .env file
Post: RE: Array in .env file

thanks but actually I think my fault was using the getenv command. The following works: PHP Code: -- $database = config('Database'); var_dump($database); -- and shows that database.default i...
3,352 Views
2 Replies
01-03-2020, 10:11 AM
rich8374
    Thread: Array in .env file
Post: Array in .env file

I was hoping from the docs here: Treating Environment Variables as Arrays (https://codeigniter4.github.io/userguide/general/configuration.html#treating-environment-variables-as-arrays) that I could ac...
3,352 Views
2 Replies
01-03-2020, 04:18 AM
rich8374
    Thread: Validation with Arrays as Field Names
Post: Validation with Arrays as Field Names

I am trying to use Form Validation with an Array for field names. I was hoping that it was possible to validate each field individually, I've followed the documentation closely but I when I submit the...
2,282 Views
1 Replies
02-07-2019, 10:03 AM
rich8374
    Thread: Why can't database session driver use a persistent connection?
Post: RE: Why can't database session driver use a persis...

Got any sources for that MySQL recommendation? The PHP link has got comments dating back 15 years - and I'm trying to understand if this is a legacy problem that's now resolved. It seems that it's s...
5,129 Views
4 Replies
01-12-2018, 01:45 AM
rich8374
    Thread: Why can't database session driver use a persistent connection?
Post: Why can't database session driver use a persistent...

Hi, Does anyone know why the database session driver will not work if you are using a persistent database connection? I've looked in the code and this restriction was put in place back in May 2014...
5,129 Views
4 Replies
01-11-2018, 03:29 AM
rich8374

Theme © iAndrew 2016 - Forum software by © MyBB