0
如何顯示在視圖function day_s()
結果just_organize/administrador/index
笨如何顯示結果的功能在視圖
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Admin extends MY_Controller {
public function index()
{
$this->load->view("layouts/header");
$this->load->view("layouts/navbar");
$this->load->view("just_organize/administrador/index");
$this->load->view("layouts/footer");
}
public function day_s(){
$time = date("H");
$timezone = date("e");
if ($time < "12") {
$greeting= "Good morning";
} else
if ($time >= "12" && $time < "17") {
$greeting= "Good afternoon";
} else
if ($time >= "17" && $time < "19") {
$greeting= "Good evening";
} else
if ($time >= "19") {
$greeting= "Good night";
}
}
}
消息:未定義的變量:問候:( –
檢查$問候空()函數一樣,如果(!空($問候))回聲$問候 – pradeep
現在的工作,謝謝! –