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...
2,073 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?
2,073 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...
2,073 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...
2,013 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,869 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,869 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,869 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,889 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,889 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.
1,033 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...
2,161 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,351 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,351 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...
4,060 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,536 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,257 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!
2,156 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...
2,156 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...
2,156 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,746 Views
3 Replies
01-25-2022, 05:45 AM
castle

Theme © iAndrew 2016 - Forum software by © MyBB