logo
Welcome Guest

Shoutbox
omACiDCORE: Good morning :)
add, more
(LAVALUST)Passing data from different models or any source to a view files

omACiDCORE

public function method1() {
$data['var1'] = $this->some_model->some_method();

$data['var2'] = $this->some_model2->some_method();

$data['var3'] = some_array_value
}
$this->call->view('view_file', $data)
So base jan may 3 kang array variables na pwede tawagin sa view file

foreach($data['var1'] as $var1) {
//your codes
}

foreach($data['var2'] as $var1) {
//your codes
}

foreach($data['var3'] as $var1) {
//your codes
}
Pwedeng iloop or pwede rin kumuha ng value base sa element nun array. Please refer to our topics on indexed array, associative and multidimentional array

Edited on 01.09.22 12:37 |  01.06.22 10:39

omACiDCORE
Passing-data-from-different-models-or-any-source-to-a-view-files

Quote   01.06.22 10:43

omhtaboy123
may bug tong gamit nyong script. pm me for details.

Quote   01.15.22 04:53


Script Timer: 0.0230 sec
Legal . Help