After developing in CodeIgniter, itβs hard for me to make decisions when to create a user library and when to create a user assistant.
I understand that both allow you to have business logic in yourself and can be reused through the framework (calling from another controller, etc.).
But I strongly believe that the fact that the main CI developers separate the libraries from the helpers should be the reason for this, and I think this is the reason waiting for me to open and enlighten.
CI developers there, advise PLS.
I think itβs better to include an example.
I could have
class notification_lib { function set_message() { } function get_message() {} function update_message() {} }
Alternatively, I could also include all the functions in an assistant.
In the notification_helper.php file, I will include set_message(), get_message(), update_message() ..
In any case, you can still reuse it. Thus, it made me think about how to decide when exactly we are creating the library and the assistant, especially in CI.
In a normal (frameless) php application, the choice is clear, since there is no helper, you just need to create a library to reuse the codes. But here in CI, I would like to understand the main developers of the library sections and helpers
design design-patterns codeigniter
user179432 Mar 02 '10 at 6:52 2010-03-02 06:52
source share