Jual Beli Produk Digital - Cepat, Aman, Dan Terpercaya Sejak 2012 (Ada 70698 Members, 832 Products, 4745 Topic, 13114 Comments)

Code Template pada Swaarakalibata CI

Dibuat
Login Terakhir 8 Bulan lalu,
Telah Dilihat 1875 Kali
Mahmud siregar Mengatakan : Sultan Account
om robby mohon penjelasan code ini:
<link type="text/css" rel="stylesheet" href="<?php echo base_url(); ?>application/views/<?php echo template(); ?>/background/<?php echo background(); ?>/reset.css" />
<link type="text/css" rel="stylesheet" href="<?php echo base_url(); ?>application/views/<?php echo template(); ?>/background/<?php echo background(); ?>/main-stylesheet.css" />
<link type="text/css" rel="stylesheet" href="<?php echo base_url(); ?>application/views/<?php echo template(); ?>/background/<?php echo background(); ?>/lightbox.css" />
<link type="text/css" rel="stylesheet" href="<?php echo base_url(); ?>application/views/<?php echo template(); ?>/background/<?php echo background(); ?>/shortcode.css" />
<link type="text/css" rel="stylesheet" href="<?php echo base_url(); ?>application/views/<?php echo template(); ?>/background/<?php echo background(); ?>/fonts.css" />
<link type="text/css" rel="stylesheet" href="<?php echo base_url(); ?>application/views/<?php echo template(); ?>/background/<?php echo background(); ?>/gambars.css" />
<link type="text/css" rel="stylesheet" href="<?php echo base_url(); ?>application/views/<?php echo template(); ?>/background/<?php echo background(); ?>/responsive.css" />

Ada 1 Jawaban

PHPMU.COM Support
commented on 22 Mei 2017 17:53:43
Assalam, itu kode untuk me-load file css pada masing2 template mas,..
<?php echo base_url(); ?>application/views/<?php echo template(); ?>/background/<?php echo background(); ?>/responsive.css

Berikut penjelasan dari URL di atas :
<?php echo base_url(); ?> : Url utama/domain web
application/views/  : directory yang dituju
<?php echo template(); ?> : masuk ke directory template dengan status template aktif 
/background/ : akses directory background yang aktif,..
/<?php echo background(); ?>/ : Folder background yang dituju..

<?php echo template(); ?> : kita ambil dari application/helpers/engine_helper.php :
function template(){
    $ci = & get_instance();
    $query = $ci->db->query("SELECT folder FROM templates where aktif='Y'");
    $tmp = $query->row_array();
    if ($query->num_rows()>=1){
        return $tmp['folder'];
    }else{
        return 'errors';
    }
}

<?php echo background(); ?> : kita ambil dari application/helpers/engine_helper.php :
function background(){
    $ci = & get_instance();
    $bg = $ci->db->query("SELECT gambar FROM background ORDER BY id_background DESC LIMIT 1")->row_array();
    return $bg['gambar'];
}
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!

Online