CodeIgniter Forums
Alias Helper Feature Request - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29)
+--- Thread: Alias Helper Feature Request (/showthread.php?tid=65438)



Alias Helper Feature Request - prezire - 06-12-2016

I know the CI team follows good conventions especially when it comes to helpers, which is purposefully for views as much as possible. However, I'm lazy and created alias_helper.php that contains mostly a duplicate of CI's library's, helpers, models and such without "$this->{class}->" structure. Here are a few:

$this->load->model() is now model()
$this->load->library() is now lib()
$this->load->helper() is now helper()
$this->load->view() is now view()
$this->parser->parse() is now parse()
$this->session is now sess()
$this->form_validation is now form_validation() or fv()
$this->load->vars() is now vars(), get_var(), get_vars(), clear_vars()
$this->input->post() is now post(), get(), server(), method()
and so forth...

Please let me know if the CI team can integrate this to enhance everyone's productivity and make the CI code in a way, fancy. Angel


RE: Alias Helper Feature Request - albertleao - 06-12-2016

A link to what you created would be nice.


RE: Alias Helper Feature Request - prezire - 06-13-2016

(06-12-2016, 08:21 PM)albertleao Wrote: A link to what you created would be nice.

Hope it's okay to put an external link. I haven't made it public so it's currently in my BitBucket.


RE: Alias Helper Feature Request - albertleao - 06-13-2016

(06-13-2016, 02:19 AM)prezire Wrote:
(06-12-2016, 08:21 PM)albertleao Wrote: A link to what you created would be nice.

Hope it's okay to put an external link. I haven't made it public so it's currently in my BitBucket.

Yep, no issues posting links to git, bit or anything like that as far as I know.


RE: Alias Helper Feature Request - prezire - 06-13-2016

(06-13-2016, 10:28 AM)albertleao Wrote:
(06-13-2016, 02:19 AM)prezire Wrote:
(06-12-2016, 08:21 PM)albertleao Wrote: A link to what you created would be nice.

Hope it's okay to put an external link. I haven't made it public so it's currently in my BitBucket.

Yep, no issues posting links to git, bit or anything like that as far as I know.

Cool! Let me know if you're having issues accessing the file in BitBucket and I'll get back to you right away.


RE: Alias Helper Feature Request - mwhitney - 06-14-2016

You could probably do that, but $this->class->method() will probably be a lot less common in CI4 unless people specifically choose to use it.


RE: Alias Helper Feature Request - albertleao - 06-14-2016

This may be very helpful in ci3 but I think ci4 is a lot cleaner


RE: Alias Helper Feature Request - prezire - 06-14-2016

Cool! Thanks for the input guys.