Welcome Guest, Not a member yet? Register   Sign In
CI4 use model's method in view
#10

(06-22-2020, 08:13 AM)InsiteFX Wrote: Using CodeIgniter Pagination.
NO , how can i get the culumn of foreign key of 100 record 

for example i have i table user:

-name
-surname
-id_club

and a table club

-id
-name

When i show the list of user i don't want show the id_club but i want show the club's name ...

How can i do (without a join) .

In ci3 i can use the model method in view for example (without tag)

table
name surname club

foreach (users as user)

tr
 td user->name td
 td user->surname td
 td this->club_model->findbyid($user->id_club)->name td
tr


how can i do the same in codeigniter 4 ?
Reply


Messages In This Thread
CI4 use model's method in view - by pippuccio76 - 06-21-2020, 07:06 AM
RE: CI4 use model's method in view - by InsiteFX - 06-22-2020, 03:06 AM
RE: CI4 use model's method in view - by InsiteFX - 06-22-2020, 08:13 AM
RE: CI4 use model's method in view - by pippuccio76 - 06-22-2020, 01:20 PM
RE: CI4 use model's method in view - by jreklund - 06-22-2020, 01:58 PM
RE: CI4 use model's method in view - by jinbatsu - 08-21-2020, 09:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB