CodeIgniter Forums
function called from view is showing as unused in PHPStorm - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: function called from view is showing as unused in PHPStorm (/showthread.php?tid=80169)



function called from view is showing as unused in PHPStorm - objecttothis - 09-23-2021

In my controller I have:
PHP Code:
public function save_info()
{
...


This function is used in a view
PHP Code:
<?php echo form_open('config/save_info/', ['id' => 'info_config_form''enctype' => 'multipart/form-data''class' => 'form-horizontal']); ?>

I'm right in the middle of trying to convert this application to CI4. PHPStorm is reporting the function as being unused. Is there a way for me to reference the function in such a way that PHPStorm can see where it's being used? I've noticed in Controllers and models that as long as I am instantiating/including the class properly, it will pick it up, but I'm not sure how to do this for functions referenced in views.

I suspect that because it's used as a callback, that it's not possible, but figured I'd ask.


RE: function called from view is showing as unused in PHPStorm - kenjis - 09-23-2021

Not possible.

form_open() does not call Config :: save_info().
It just get the string 'config/save_info/'.