Code Template pada Swaarakalibata CIDibuat
Login Terakhir
8 Bulan lalu,
Telah Dilihat 1875 Kali
| |
Sultan Account |
|
|
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" /> |
|
| PHPMU.COM Support commented on 22 Mei 2017 17:53:43 Sultan Account |
|
|
|
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'];
} |
|