Welcome Guest, Not a member yet? Register   Sign In
Search Results
    Thread: Help with RESTful Resource Routes
Post: RE: Help with RESTful Resource Routes

kenjis Wrote: (03-17-2022, 01:04 AM) -- You're correct. Strictly speaking, PHP Code: -- photos/(:segment)/edit -- is not needed in REST API. You can remove the edit: https://codeigniter.com...
1,910 Views
4 Replies
03-17-2022, 01:10 AM
castle
    Thread: Help with RESTful Resource Routes
Post: RE: Help with RESTful Resource Routes

sba Wrote: (03-16-2022, 08:51 AM) -- $routes->resource('photos');  -- But the CI documentation has a controller route "photos/(:segment)/edit". That doesn't follow the Restful guide, does it?
1,910 Views
4 Replies
03-16-2022, 11:58 PM
castle
    Thread: Help with RESTful Resource Routes
Post: Help with RESTful Resource Routes

Hi, Reading REST Resource Naming Guide (https://restfulapi.net/resource-naming/) item 2.4. Never use CRUD function names in URIs, I noticed that the example on the CI4 documentation (https://code...
1,910 Views
4 Replies
03-16-2022, 06:58 AM
castle
    Thread: When should I use esc()?
Post: When should I use esc()?

Hi, I need help with where to use esc() function.  Do I need to use esc() on every single input text field? For example. I have a form that presents the user with two fields. One is a text field...
1,629 Views
1 Replies
02-19-2022, 10:04 AM
castle
    Thread: How to retrieve images from /writable/uploads to be displayed?
Post: RE: How to retrieve images from /writable/uploads ...

InsiteFX Wrote: (02-14-2022, 02:24 AM) -- public -- assets ---- images ---- js ---- uploads ---- etc Then you can access them like this. PHP Code: -- href="" -- -- Ok. Thank you. [hr]...
3,437 Views
6 Replies
02-14-2022, 04:57 AM
castle
    Thread: How to retrieve images from /writable/uploads to be displayed?
Post: RE: How to retrieve images from /writable/uploads ...

iRedds Wrote: (02-13-2022, 01:25 PM) -- This is not a framework level question. If the image should be available to everyone, then it makes no sense to store it outside the public folder. If access...
3,437 Views
6 Replies
02-13-2022, 05:29 PM
castle
    Thread: How to retrieve images from /writable/uploads to be displayed?
Post: How to retrieve images from /writable/uploads to ...

Hi,  I know that /writable folder cannot access directly on URL since it's outside the public folder. But here is my setup: - I have a CRUD for manufacturers. For the create.php page, it's allow...
3,437 Views
6 Replies
02-13-2022, 11:57 AM
castle
    Thread: Is it possible to select two cells with one query?
Post: RE: Is it possible to select two cells with one qu...

what?
1,632 Views
4 Replies
02-12-2022, 09:06 AM
castle
    Thread: Is it possible to select two cells with one query?
Post: Is it possible to select two cells with one query?

Hi, I have these two queries: PHP Code: -- $id = $db->table('discount')->getWhere(['discount_assignment_id' => $id, 'active' => 1])->getFirstRow()->id ?: null; $name = $db->table('discount')->getW...
1,632 Views
4 Replies
02-12-2022, 05:20 AM
castle
    Thread: Can I have global filters segmented?
Post: Can I have global filters segmented?

Hi, My app is divided in Backend and Frontend. Is there a way to use global filters (App\Config\Filters) only for Backend's requests?  Thanks.
929 Views
1 Replies
02-09-2022, 08:46 AM
castle
    Thread: Global access to $session in controlers and modules
Post: RE: Global access to $session in controlers and mo...

kenjis Wrote: (02-03-2022, 05:14 PM) -- It seems you need to learn PHP's variables and properties. See https://www.php.net/manual/en/language.variables.basics.php https://www.php.net/manual/en/l...
1,899 Views
4 Replies
02-04-2022, 11:24 AM
castle
    Thread: How do I get the total amount from a column?
Post: RE: How do I get the total amount from a column?

Sorry, I still don't get it.
2,052 Views
4 Replies
01-31-2022, 07:19 AM
castle
    Thread: How do I get the total amount from a column?
Post: How do I get the total amount from a column?

Hi, I'm upgrading my CI3 model to CI4, but things are not working well. CI 3 PHP Code: -- // Sales $this->db->select_sum('total'); $result = $this->x_model->get('order', array('created_on ...
2,052 Views
4 Replies
01-31-2022, 05:28 AM
castle
    Thread: How to get data after saving the model
Post: RE: How to get data after saving the model

I may be too newbie, but what's the case for that? I'm wondering why would you save the data and retrieve it right back. If the data hasn't changed, can't you just save the $data to another variable t...
3,652 Views
6 Replies
01-27-2022, 04:39 AM
castle
    Thread: What are the differences among initialize(), constructor and early options?
Post: What are the differences among initialize(), const...

Hi, Sorry if the title is confusing, but looking at the documentation I got wondering. How are they different? PHP Code: -- class UserModel extends UserAuthModel {     /**     * Called during i...
1,426 Views
2 Replies
01-27-2022, 04:27 AM
castle
    Thread: Why can't we have folders with the same name in App\Controllers and \Public?
Post: RE: Why can't we have folders with the same name i...

Thank you.
3,001 Views
4 Replies
01-26-2022, 06:42 AM
castle
    Thread: How do I overwrite the protected table in Model?
Post: RE: How do I overwrite the protected table in Mode...

I got it. Thanks!
1,956 Views
4 Replies
01-26-2022, 04:49 AM
castle
    Thread: How do I overwrite the protected table in Model?
Post: RE: How do I overwrite the protected table in Mode...

I thought about that, but I was not sure if it was ok for a library to have more than one model. I don't remember seeing other libraries with multiple models. So, I thought it could be a bad practice...
1,956 Views
4 Replies
01-25-2022, 07:43 PM
castle
    Thread: How do I overwrite the protected table in Model?
Post: How do I overwrite the protected table in Model?

Hi, My Model has this: PHP Code: -- protected $table = 'users'; -- My library: PHP Code: -- public function __construct()     {         $this->AuthModel = new AuthModel();         $this->Ses...
1,956 Views
4 Replies
01-25-2022, 06:29 PM
castle
    Thread: How do I remove index.php using spark?
Post: RE: How do I remove index.php using spark?

Thanks
4,009 Views
3 Replies
01-25-2022, 05:45 AM
castle

Theme © iAndrew 2016 - Forum software by © MyBB