Trying to get property of non-object

$marker['infowindow_content'] .= '<h5 class="media-heading">'.$value->nama.'</h5>'; $marker['infowindow_content'] .= '<a>'.$value->alamat.'</a>'; $marker['infowindow_content'] .= '<a>'.$value->no_pengelola.'</a>'; $marker['infowindow_content'] .= '<a>'.$value->ket.'</a>';

dibagian itu yang salah .. kira"yg salah dari kodingan saya apa yaa ?

 public function index(){
        $this->load->library('googlemaps');
        $config['center'] = '-6.8958555, 109.6394838';
        $config['zoom'] = '13';
        $this->googlemaps->initialize($config);

        $butik = $this->Butik_model->getAllButik();
        foreach ($butik as $key => $value) {
            $marker = array();
            $marker['animation']= 'DROP';
            $marker['position']= '$value->latitude, $value->longitude';
            $marker['infowindow_content'] = '<div class="media" style="width:300px">';
            $marker['infowindow_content'] .= '<div class="media-left">';
            $marker['infowindow_content'] .= '</div>';
            $marker['infowindow_content'] .= '<div class="media-body">';
            $marker['infowindow_content'] .= '<h5 class="media-heading">'.$value->nama.'</h5>';
            $marker['infowindow_content'] .= '<a>'.$value->alamat.'</a>';
            $marker['infowindow_content'] .= '<a>'.$value->no_pengelola.'</a>';
            $marker['infowindow_content'] .= '<a>'.$value->ket.'</a>';
            $marker['infowindow_content'] = '</div> ';
            $marker['infowindow_content'] = '</div> ';

            # code...
            $this->googlemaps->add_marker($marker);
        }

        $data['map'] = $this->googlemaps->create_map();

        $data['judul'] = 'Halaman admin';

        $this->load->view('templates/header', $data);
        $this->load->view('home/index', $data, FALSE);
        $this->load->view('templates/footer');
    }

avatar ulummadridista12
@ulummadridista12

1 Kontribusi 0 Poin

Diperbarui 5 tahun yang lalu

1 Jawaban:

salah satu property valuenya tidak ada, dari $value itu coba <a href=' https://sekolahkoding.com/forum/cara-menampilkan-error-debug-di-php-1552899672 '>belajar debug di php</a>, mulai dari mengeluarkan semua isi $value nya, cocokkan nilai mana yang tidak tersedia

avatar hilmanski
@hilmanski

2686 Kontribusi 2135 Poin

Dipost 5 tahun yang lalu

Login untuk ikut Jawaban