Showing posts with label echo. Show all posts
Showing posts with label echo. Show all posts

Friday, 29 May 2026

Menampilkan teks biasa di halaman php moodle

Kalau ingin menampilkan teks biasa, harus memakai:

echo

atau HTML.

Yang benar:

echo html_writer::start_div();

echo '<b>Pilih opsi berikut untuk Cetak Harian Bulanan</b><br><br>';

echo html_writer::label('Bulan', 'bulan') . ' ';

Atau lebih rapi:

echo html_writer::start_div(
    null,
    null,
    ['style' => 'margin-top:10px']
);

echo html_writer::tag(
    'div',
    'Pilih opsi berikut untuk Cetak Harian Bulanan',
    [
        'style' => '
            font-weight:bold;
            margin-bottom:8px;
            color:#0f4c81;
        '
    ]
);

echo html_writer::label('Bulan', 'bulan') . ' ';

Hasilnya nanti muncul seperti judul kecil di atas dropdown.