passing variable in model - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: passing variable in model (/showthread.php?tid=78684) |
passing variable in model - eleumas - 02-25-2021 PHP Code: function get_articles() { I have this snippet in my model. How can I pass the variable $articleId to get_ip function? Thanks. RE: passing variable in model - Chroma - 02-25-2021 Before the return of $articles, use a loop to iterate through each article int he list one at a time and call get_ip() one each one in the loop. Then do something with the result that is passed back. |