本文整理汇总了PHP中Home类的典型用法代码示例。如果您正苦于以下问题:PHP Home类的具体用法?PHP Home怎么用?PHP Home使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Home类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseData
/**
* aangepaste parseData functie die overweg kan met 1 rij ipv een array met daarin een array
*
* @param unknown_type $data
* @return unknown
*/
function parseData($data)
{
$result = array();
$result['gebruikersnaam'] = $data["uid"][0];
$result['voornaam'] = $data["ugentpreferredgivenname"][0];
$result['achternaam'] = $data["ugentpreferredsn"][0];
$result['email'] = $data["mail"][0];
$kot = $data["ugentdormpostaladdress"][0];
if ($kot != "") {
$kot = explode("\$", $kot);
if (strpos(" " . $kot[0], "HOME")) {
//VUILE LDAP HACK :(
$kot[0] = $kot[0] == "HOME BERTHA DE VRIES" ? "HOME BERTHA DE VRIESE" : $kot[0];
$home = Home::getHome("ldapNaam", $kot[0]);
$result['homeId'] = $home->getId();
$result['home'] = $home->getLangeNaam();
$temp = explode(":", $kot[1]);
if (sizeof($temp) > 1) {
$result['kamer'] = $temp[1];
} else {
$temp = explode("(", $kot[1]);
$temp = explode(")", $temp[1]);
if (sizeof($temp) > 1) {
$result['kamer'] = $home->getKamerPrefix() . "." . $temp[0];
} else {
$temp = explode("K. ", $kot[1]);
$result['kamer'] = $home->getKamerPrefix() . "." . converteer($temp[0]);
//er wordt nog een oud kamernummer gebruikt
}
}
}
}
return $result;
}
示例2: __construct
public function __construct()
{
$this->splitUrl();
if (!$this->url_controller) {
require APP . 'controllers/home.php';
$page = new Home();
$page->index();
} elseif (file_exists(APP . 'controllers/' . $this->url_controller . '.php')) {
require APP . 'controllers/' . $this->url_controller . '.php';
$this->url_controller = new $this->url_controller();
if (method_exists($this->url_controller, $this->url_action)) {
if (!empty($this->url_params)) {
call_user_func_array(array($this->url_controller, $this->url_action), $this->url_params);
} else {
$this->url_controller->{$this->url_action}();
}
} else {
if (strlen($this->url_action) == 0) {
$this->url_controller->index();
} else {
header('location: ' . URL . 'error');
}
}
} else {
header('location: ' . URL . 'error');
}
}
示例3: __construct
/**
* "Start" the application:
* Analyze the URL elements and calls the according controller/method or the fallback
*/
public function __construct()
{
// create array with URL parts in $url
$this->splitUrl();
// check for controller: no controller given ? then load start-page
if (!$this->url_controller) {
require APP . 'controller/home.php';
$page = new Home();
$page->index();
} elseif (file_exists(APP . 'controller/' . $this->url_controller . '.php')) {
// here we did check for controller: does such a controller exist ?
// if so, then load this file and create this controller
require APP . 'controller/' . $this->url_controller . '.php';
$this->url_controller = new $this->url_controller();
if (method_exists($this->url_controller, $this->url_action)) {
if (!empty($this->url_params)) {
call_user_func_array(array($this->url_controller, $this->url_action), $this->url_params);
} else {
$this->url_controller->{$this->url_action}();
}
} else {
if (strlen($this->url_action) == 0) {
// no action defined: call the default index() method of a selected controller
$this->url_controller->index();
} else {
header('location: ' . URL . 'error');
}
}
} else {
header('location: ' . URL . 'error');
}
}
示例4: index
public function index()
{
$aViewParameter = array();
$aViewParameter['page'] = 'home';
$this->load->model('analog_model');
$aViewParameter['sucess'] = '0';
$aObjHome = new Home();
$aObjHome->checkSettingsSaved();
$sResponse = get_rlb_status();
$sValves = $sResponse['valves'];
$sRelays = $sResponse['relay'];
$sPowercenter = $sResponse['powercenter'];
$sPump = array($sResponse['pump_seq_0_st'], $sResponse['pump_seq_1_st'], $sResponse['pump_seq_2_st']);
$aViewParameter['sValves'] = $sValves;
$aViewParameter['sRelays'] = $sRelays;
$aViewParameter['sPowercenter'] = $sPowercenter;
$aViewParameter['sPump'] = $sPump;
$aViewParameter['relay_count'] = strlen($sRelays);
$aViewParameter['valve_count'] = strlen($sValves);
$aViewParameter['power_count'] = strlen($sPowercenter);
$aViewParameter['pump_count'] = count($sPump);
if ($this->input->post('command') == 'Save') {
$sDeviceName = $this->input->post('sDeviceName');
$this->analog_model->saveAnalogDevice($sDeviceName);
$aViewParameter['sucess'] = '1';
}
$aAllAnalogDevice = $this->analog_model->getAllAnalogDevice();
$aAllANalogDeviceDirection = $this->analog_model->getAllAnalogDeviceDirection();
$aViewParameter['aResponse'] = array('AP0' => $sResponse['AP0'], 'AP1' => $sResponse['AP1'], 'AP2' => $sResponse['AP2'], 'AP3' => $sResponse['AP3']);
$aViewParameter['aAllAnalogDevice'] = $aAllAnalogDevice;
$aViewParameter['aAllANalogDeviceDirection'] = $aAllANalogDeviceDirection;
$this->load->view('Analog', $aViewParameter);
}
示例5: run
public static function run($url)
{
if (!empty($url) && strtolower($url) != "home") {
$url = explode("/", $url);
$class = ucfirst(strtolower($url[0]));
if (count($url) > 1) {
$method = $url[1] ? strtolower($url[1]) : null;
if (count($url) > 2) {
$param = $url[2] ? $url[2] : null;
}
}
if (file_exists(DIR_CONTROLLER . $class . '.php')) {
$obj = new $class();
if (isset($method) && method_exists($obj, $method)) {
if (isset($param)) {
$obj->{$method}($param);
} else {
$obj->{$method}();
}
} else {
if (isset($method)) {
include DIR_BASE . 'app/view/erro500.php';
}
}
$obj->show();
} else {
include DIR_BASE . 'app/view/erro500.php';
}
} else {
$obj = new Home();
$obj->show();
}
}
示例6: __construct
public function __construct()
{
$this->getUrlWithoutModRewrite();
if (!$this->url_controller) {
require APP . 'controllers/home.php';
$page = new Home();
$page->index();
} elseif (file_exists(APP . 'controllers/' . $this->url_controller . '.php')) {
require APP . 'controllers/' . $this->url_controller . '.php';
$this->url_controller = new $this->url_controller();
if (method_exists($this->url_controller, $this->url_action)) {
if (!empty($this->url_params)) {
// Llama el metodo y le pasa los argumentos
call_user_func_array(array($this->url_controller, $this->url_action), $this->url_params);
} else {
//Si no hay parametros llama a el metodo sin argumentos.
$this->url_controller->{$this->url_action}();
}
} else {
if (strlen($this->url_action) == 0) {
// Si no se define alguna accion defino por defecto la index
$this->url_controller->index();
} else {
//Si la accion no existe lanzo el error
require APP . 'controllers/error.php';
$page = new Error();
$page->index();
}
}
} else {
require APP . 'controllers/error.php';
$page = new Error();
$page->index();
}
}
示例7: get
function get()
{
$profile_uid = intval($_GET['p']) ? intval($_GET['p']) : -1;
$load = argc() > 1 && argv(1) == 'load' ? 1 : 0;
header("Content-type: text/html");
echo "<!DOCTYPE html><html><body>\r\n";
echo array_key_exists('msie', $_GET) && $_GET['msie'] == 1 ? '<div>' : '<section>';
$mod = new Home();
$text = $mod->get($profile_uid, $load);
$pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
$replace = "<img\${1} dst=\"\${2}\"";
// $text = preg_replace($pattern, $replace, $text);
/*
if(! $load) {
$replace = '<br />' . t('[Embedded content - reload page to view]') . '<br />';
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
$text = preg_replace($pattern, $replace, $text);
}
*/
echo str_replace("\t", ' ', $text);
echo array_key_exists('msie', $_GET) && $_GET['msie'] == 1 ? '</div>' : '</section>';
echo "</body></html>\r\n";
// logger('update_home: ' . $text);
killme();
}
示例8: get_article_list
public function get_article_list($start = 0, $limit = 10, $keyword, $type = 1)
{
$obj = new Home();
$query = $this->article_model->get_article_list($type, $start, $limit, $keyword);
if ($query != NULL) {
$i = 0;
foreach ($query->result() as $q) {
$path = !isset($q->path_image) ? "" : $q->path_image;
$title = !isset($q->title) ? "" : $q->title;
$tag = !isset($q->tag) ? "" : $q->tag;
$article_id = !isset($q->article_id) ? "" : $q->article_id;
$read_more = base_url("article/read/" . $article_id . "/" . $obj->slug($title) . "");
$year = !isset($q->year) ? 0 : $q->year;
$month = !isset($q->month) ? 0 : $q->month;
$day = !isset($q->day) ? 0 : $q->day;
$default = base_url('assets/img/article/default-image.png');
$article_id = !isset($q->article_id) ? "" : $q->article_id;
$read_more = base_url("article/read/" . $year . '/' . $month . '/' . $day . '/' . $article_id . "/" . $this->slug($title) . "");
$title = $type == 2 || $type == 3 || $type == 4 ? $this->global_common->get_title(26, $title) : $title;
$img = "<p><a target='_blank' href='" . $read_more . "'>";
//$img .= "<img class='img-responsive opacity' width='480px' src='". base_url($path) ."' alt='".$title."'/>";
$img .= "<img class='img-responsive opacity lazy' width='480px' src='" . $default . "' data-original='" . base_url($path) . "' alt='" . $title . "'>";
$img .= "</a></p>";
$category = !isset($q->category) ? "" : $q->category;
$recent_article_category = "<a href='" . base_url('article/page/0/0/' . $category) . "'>" . $category . "</a>";
$data[$i] = array("article_id" => $article_id, "article_category_id" => !isset($q->article_category_id) ? "" : $q->article_category_id, "image_id" => !isset($q->image_id) ? "" : $q->image_id, "title" => "<a href='" . $read_more . "'>" . $title . "</a>", "read_more" => "<a class='btn btn-primary' href='" . $read_more . "'>Read More</a>", "tag" => $this->global_common->get_list_tag($tag, 'article'), "summary" => !isset($q->summary) ? "" : $obj->get_preview_summary($q->summary), "full_name" => !isset($q->nama_lengkap) ? "" : $q->nama_lengkap, "created_date" => !isset($q->created_date) ? "" : $q->created_date, "image" => $img, "recent_article_category" => $recent_article_category, "count_article_comment" => $this->article_model->count_article_comment($article_id)->count_article_comment, "count_article_stat" => $this->article_model->count_article_stat($article_id)->count_article_stat);
$i++;
}
} else {
$data = NULL;
}
return $data;
}
示例9: sitemap
function sitemap($t)
{
$result = $this->sitemap_model->get_url_sitemap($t);
$home = new Home();
if ($result != false) {
foreach ($result as $row) {
$date = explode(" ", $row->created_date);
$y = explode("-", $date[0]);
$m = explode("-", $date[0]);
$d = explode("-", $date[0]);
if ($t == 'article') {
$url = base_url("article/read/" . $y[0] . '/' . $m[1] . '/' . $d[2] . '/' . $row->article_id . "/" . $home->slug($row->title) . "");
}
if ($t == 'news') {
$url = base_url("news/read/" . $y[0] . '/' . $m[1] . '/' . $d[2] . '/' . $row->news_id . "/" . $home->slug($row->title) . "");
}
if ($t == 'video') {
$url = base_url("video/watch/" . $y[0] . '/' . $m[1] . '/' . $d[2] . '/' . $row->video_id . "/" . $home->slug($row->title) . "");
}
$datetime = new DateTime($row->created_date);
$data[] = array("loc" => $url, "lastmod" => $datetime->format('Y-m-d\\TH:i:sP'), "priority" => 0.5, "changefreq" => "daily");
}
}
return $data;
}
示例10: __construct
/**
* "Start" the application:
* Analyze the URL elements and calls the according controller/method or the fallback
*/
public function __construct()
{
// create array with URL parts in $url
$this->splitUrl();
// check for controller: no controller given ? then load start-page
if ($this->url_controller) {
$controller = ucfirst(strtolower($this->url_controller));
$pathController = APP . "controllers/{$controller}.controller.php";
if (file_exists($pathController)) {
// llamamos al archivo controlador
require $pathController;
$action = strtolower($this->url_action) . 'Action';
if (!empty($this->url_params)) {
$this->url_controller = new $controller($this->url_params);
} else {
$this->url_controller = new $controller();
}
// comprobamos si la accion existe
if (method_exists($this->url_controller, $action)) {
$this->url_controller->{$action}($this->url_params);
} else {
$params = array_merge(array($this->url_action), $this->url_params);
$this->url_controller->index($params);
}
} else {
header('location: ' . URL . 'error');
}
} elseif (!$this->url_controller) {
require APP . 'controllers/Home.controller.php';
$page = new Home();
$page->index();
}
}
示例11: testWebDriver
/**
* @test
* @group session
* @group blacklist
*/
public function testWebDriver()
{
$home_page = new Home(self::$session);
$home_page->open();
$schedule_page = $home_page->navigate_to('Schedule');
$schedule_page->open_session('WebDriver!');
$this->assertEquals($schedule_page->title, "WebDriver!");
}
示例12: enter
/**
*
* @param $controller
*/
function enter($controller)
{
// Call a given controller, except when the segment1 is "null", in which, call Home.
if ($controller != "null") {
$instance = new $controller();
$instance->main();
} else {
$instance = new Home();
$instance->main();
}
}
示例13: __construct
/**
* "Start" the application:
* Analyze the URL elements and calls the according controller/method or the fallback
*/
public function __construct()
{
// create array with URL parts in $url
$this->getUrlWithoutModRewrite();
$GLOBALS["beans"] = new stdClass();
$this->openDatabaseConnection();
$this->loadModels();
$this->loadHelpers();
date_default_timezone_set('UTC');
// check for controller: no controller given ? then load start-page
if (!$this->url_controller) {
require APP . 'controllers/home.php';
$page = new Home();
$page->index();
} elseif (file_exists(APP . 'controllers/' . $this->url_controller . '.php')) {
// here we did check for controller: does such a controller exist ?
// If user is not logged in, restrict to the login page only
$this->checkLoggedIn();
// if so, then load this file and create this controller
// example: if controller would be "car", then this line would translate into: $this->car = new car();
require APP . 'controllers/' . $this->url_controller . '.php';
$this->url_controller = new $this->url_controller();
// check for method: does such a method exist in the controller ?
if (method_exists($this->url_controller, $this->url_action)) {
if (!empty($this->url_params)) {
// Call the method and pass arguments to it
call_user_func_array(array($this->url_controller, $this->url_action), $this->url_params);
} else {
// If no parameters are given, just call the method without parameters, like $this->home->method();
$this->url_controller->{$this->url_action}();
}
} else {
if (strlen($this->url_action) == 0) {
// no action defined: call the default index() method of a selected controller
$this->url_controller->index();
} else {
// defined action not existent: show the error page
require APP . 'controllers/error.php';
$page = new Error();
$page->index();
}
}
} else {
require APP . 'controllers/error.php';
$page = new Error();
$page->index();
}
}
示例14: __construct
/**
* "Start" the application:
* Analyze the URL elements and calls the according controller/method or the fallback
*/
public function __construct()
{
// create array with URL parts in $url
$this->getUrlWithoutModRewrite();
// check for controller: no controller given ? then load start-page
if (!$this->url_controller) {
require APP . 'controllers/home.php';
$page = new Home();
$page->index();
} elseif (file_exists(APP . 'controllers/' . $this->url_controller . '.php')) {
// here we did check for controller: does such a controller exist ?
// if so, then load this file and create this controller
// example: if controller would be "car", then this line would translate into: $this->car = new car();
require APP . 'controllers/' . $this->url_controller . '.php';
/**
* Bad workaround due to list being a reserved keyword. Should probably rename to something other than list in production.
**/
if ($this->url_controller == 'list') {
$this->url_controller = new days();
} else {
$this->url_controller = new $this->url_controller();
}
// check for method: does such a method exist in the controller ?
if (method_exists($this->url_controller, $this->url_action)) {
if (!empty($this->url_params)) {
// Call the method and pass arguments to it
call_user_func_array(array($this->url_controller, $this->url_action), $this->url_params);
} else {
// If no parameters are given, just call the method without parameters, like $this->home->method();
$this->url_controller->{$this->url_action}();
}
} else {
if (strlen($this->url_action) == 0) {
// no action defined: call the default index() method of a selected controller
$this->url_controller->index();
} else {
// defined action not existent: show the error page
require APP . 'controllers/error.php';
$page = new Error();
$page->index();
}
}
} else {
require APP . 'controllers/error.php';
$page = new Error();
$page->index();
}
}
示例15: errors
public static function errors($code = 404, $title = '', $message = '')
{
$ajax = Request::ajax();
if (!$code) {
$code = 500;
$title = 'Internal Server Error';
$message = 'We got problems over here. Please try again later!';
} else {
if ($code == 404) {
$title = 'Oops! You\'re lost.';
$message = 'We can not find the page you\'re looking for.';
}
}
if (Request::ajax()) {
return Response::json(['error' => ['message' => $message]], $code);
}
$arrData = [];
$arrData['content'] = View::make('frontend.errors.error')->with(['title' => $title, 'code' => $code, 'message' => $message]);
$arrData['metaInfo'] = Home::getMetaInfo();
$arrData['metaInfo']['meta_title'] = $title;
$arrData['types'] = Home::getTypes();
$arrData['categories'] = Home::getCategories();
$arrData['headerMenu'] = Menu::getCache(['header' => true]);
return View::make('frontend.layout.default')->with($arrData);
}