• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP meta函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中meta函数的典型用法代码示例。如果您正苦于以下问题:PHP meta函数的具体用法?PHP meta怎么用?PHP meta使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了meta函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: test_meta

 public function test_meta()
 {
     $this->assertEquals("<meta name=\"test\" content=\"foo\" />\n", meta('test', 'foo'));
     $this->assertEquals("<meta name=\"foo\" content=\"\" />\n", meta(array('name' => 'foo')));
     $this->assertEquals("<meta charset=\"foo\" />\n", meta(array('name' => 'foo', 'type' => 'charset')));
     $this->assertEquals("<meta charset=\"foo\" />\n", meta(array('name' => 'foo', 'type' => 'charset')));
 }
开发者ID:fathiraz,项目名称:lebahapi,代码行数:7,代码来源:html_helper_test.php


示例2: Delivery

	function Delivery()
	{
		$this->CheckAdminPrivs('print');
		$oid = get('oid', 'number');
		$senderID = get('sender', 'int');
				$lastADDR = meta('cdp_service_lastADDR');
		if ($lastADDR != $senderID)
		{
			meta('cdp_service_lastADDR', $senderID);
		}
				$cdpResult = logic('express')->cdp()->CreatePrinterConfig($oid, $senderID);
		if ($cdpResult['__error__'])
		{
			$this->Messager('您还没有设置打印模板,系统正在跳转到模板编辑页面,请稍候...', '?mod=express&code=corp&op=delivery&id='.$cdpResult['corpID'], 3);
		}
				logic('express')->cdp()->Printed($oid, $senderID);
				$cdpCFG = $cdpResult['config'];
		$cdpDATA = $cdpResult['cdp'];
				$background = logic('upload')->GetOne($cdpDATA['bgid']);
		$background['extra'] = unserialize($background['extra']);
		if (!$background['extra']['width'] || !$background['extra']['height'])
		{
			$background['extra'] = handler('image')->Info($background['path']);
			logic('upload')->Field($background['id'], 'extra', serialize(array('width'=>$background['extra']['width'],'height'=>$background['extra']['height'])));
		}
				include handler('template')->file('@admin/print_delivery');
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:27,代码来源:print.mod.php


示例3: view

 function view($id)
 {
     $data['rs'] = new Dentist($id);
     $this->template->title(lang_decode($data['rs']->name) . ' - DrTooth Dental Clinic');
     $this->template->append_metadata(meta('description', lang_decode($data['rs']->name) . strip_tags(lang_decode($data['rs']->detail))));
     $this->template->build('view', $data);
 }
开发者ID:unisexx,项目名称:drtooth,代码行数:7,代码来源:dentists.php


示例4: finder

	function finder( $uid, $productid )
	{
		if (!meta('p_ir_'.$productid))
		{
			return false;
		}
		$sql = 'select finder,findtime from ' . TABLE_PREFIX . 'system_members where uid = ' . intval($uid);
		$query = $this->DatabaseHandler->Query($sql);
		if ( ! $query ) return false;
		$finder = $query->GetRow();
		$finderid = $finder['finder'];
		$findtime = $finder['findtime'];
		if ( $finderid == 0 || $findtime == 0 )
		{
			return false;
		}
		if ( $findtime + (72 * 3600) < time() )
		{
			return false;
		}
				$sql = 'select count(*) from ' . TABLE_PREFIX . 'tttuangou_order where userid = ' . intval($uid) . ' AND paytime > 0';
		$query = $this->DatabaseHandler->Query($sql);
		$result = $query->GetRow();
		if ( $result['count(*)'] > 1 )
		{
			return false;
		}
		$ary = array(
			'buyid' => $uid, 'buytime' => time(), 'productid' => $productid, 'finderid' => $finderid, 'findtime' => $findtime
		);
		$this->DatabaseHandler->SetTable(TABLE_PREFIX . 'tttuangou_finder');
		$result = $this->DatabaseHandler->Insert($ary);
		return true;
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:34,代码来源:me.logic.php


示例5: index

 function index()
 {
     // check permission
     if ($this->account_model->check_admin_permission('account_permissions', 'account_manage_permission') == false) {
         redirect('site-admin');
     }
     // load library
     $this->load->library('session');
     // load languages
     $this->modules_model->load_languages();
     if ($this->session->flashdata('update_status') !== null) {
         $output['form_status'] = $this->session->flashdata('update_status');
     }
     $output['list_permissions'] = $this->account_model->list_level_permission();
     $output['admin_content'] = $this->load->view('site-admin/account_permission_view', $output, true);
     // headr tags output###########################################
     $output['page_title'] = $this->config_model->load('site_name') . $this->config_model->load('page_title_separator') . $this->lang->line('account_permissions');
     // meta tag
     $output['page_metatag'][] = meta('Cache-Control', 'no-cache', 'http-equiv');
     $output['page_metatag'][] = meta('Pragma', 'no-cache', 'http-equiv');
     // link tag
     //$output['page_linktag'][] = link_tag( 'favicon.ico', 'shortcut icon', 'image/ico' );
     //$output['page_linktag'][] = link_tag( 'favicon2.ico', 'shortcut icon2', 'image/ico' );
     // script tag
     //$output['page_scripttag'][] = "<script type=\"text/javascript\" src=\"tinymcs.js\"></script>\n";
     //$output['page_scripttag'][] = "<script type=\"text/javascript\" src=\"fckkeditor.js\"></script>\n";
     // end headr tags output###########################################
     // output
     $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate');
     $this->output->set_header('Pragma: no-cache');
     $this->load->view('site-admin/index_view', $output);
 }
开发者ID:Rundiz,项目名称:vee-web-start,代码行数:32,代码来源:account_permission.php


示例6: log

 public function log()
 {
     meta()->set('title', 'Web Deploy Log');
     if (is_object($error = $this->check())) {
         return $error;
     }
     $last = (int) input('last') ?: config('git')['log_history'];
     return self::content('admin.log', array('last' => $last, 'log' => $this->git()->getLogStat($last)));
 }
开发者ID:eusonlito,项目名称:web-deploy,代码行数:9,代码来源:Admin.php


示例7: category

function category($code = null)
{
    if ($code) {
        $meta = meta('company_category');
        return $meta->load($code);
    } else {
        return meta('company_category');
    }
}
开发者ID:thruthesky,项目名称:backend,代码行数:9,代码来源:init.php


示例8: log

 public function log()
 {
     meta()->set('title', 'GIT Log');
     if (is_object($error = $this->check())) {
         return $error;
     }
     $git = $this->git();
     $last = (int) input('last') ?: config('git')['log_history'];
     return self::content('git.log', array('last' => $last, 'log' => $git->setCommitLinks($git->getLogStat($last))));
 }
开发者ID:eusonlito,项目名称:web-deploy,代码行数:10,代码来源:Git.php


示例9: index

 function index()
 {
     $this->title = 'Welcome to Becak MVC Framework !';
     $this->meta .= meta('keywords', 'becak, php5, framework');
     $this->head .= css('welcome.js');
     $this->head .= script('welcome');
     $data['var'] = 'This page generated by Becak MVC Framework.';
     $this->body = view('view_welcome', $data);
     app_view('view_base');
 }
开发者ID:anugrahbsoe,项目名称:Becak-HMVC-Framework,代码行数:10,代码来源:page.php


示例10: uninstall

 public function uninstall()
 {
     $attend = node('philgo_attend');
     if ($attend->exists()) {
         $attend->uninit();
     }
     $meta = meta('philgo');
     if ($meta->exists()) {
         $meta->uninit();
     }
 }
开发者ID:thruthesky,项目名称:overframe,代码行数:11,代码来源:Philgo.php


示例11: __construct

 public function __construct()
 {
     $this->CI =& get_instance();
     //$this->CI调用框架方法
     $this->CI->load->helper(array('html', 'string', 'url'));
     $this->CI->load->model('tool/spider_model');
     if (!is_cli()) {
         echo doctype('html4-trans') . meta('Content-type', 'text/html;charset=utf-8', 'equiv');
         echo link_tag(base_url('public/image/favicon.ico'), 'shortcut icon', 'image/ico');
     }
 }
开发者ID:ahmatjan,项目名称:lv,代码行数:11,代码来源:Spider_func.php


示例12: __construct

 public function __construct()
 {
     parent::__construct();
     loader::sys_helper('view');
     loader::sys_helper('head_tag');
     $this->base = common::config_item('base_url');
     $this->base_url = common::config_item('base_url') . common::config_item('index_page');
     $this->base_img = common::config_item('source_url') . 'images/';
     $this->meta = meta('Content-type', 'text/html; charset=utf-8', 'equiv');
     $this->meta .= meta('author', 'Eko Heri Susanto');
 }
开发者ID:anugrahbsoe,项目名称:Becak-HMVC-Framework,代码行数:11,代码来源:global_controller.php


示例13: seo

 function seo()
 {
     // 		bug($this->title);
     if ($this->title === null) {
         $this->title = lang('sitename');
     } else {
         $this->title = $this->title . ' - ' . lang('sitename');
     }
     // 		bug($this->title);
     echo HTML('title', $this->title);
     $this->description = lang('About Parkorn Leather Description');
     echo meta('description', $this->description);
 }
开发者ID:quanict,项目名称:parkornleather,代码行数:13,代码来源:pshop.php


示例14: update

 public function update()
 {
     meta()->set('title', 'RSYNC Update');
     if (is_object($response = $this->check())) {
         return $response;
     }
     if (input('find') === 'true') {
         $files = (new Repository\Rsync())->getUpdatedFiles();
     } else {
         $files = array();
     }
     return self::content('rsync.update', array('config' => config('rsync'), 'files' => $files, 'processor' => (new Processor\Rsync())->update()));
 }
开发者ID:eusonlito,项目名称:web-deploy,代码行数:13,代码来源:Rsync.php


示例15: meta_last_page

/**
 * To show last meta
 * 
 ****/
function meta_last_page()
{
    $meta = array(array('name' => 'robots', 'content' => 'index, follow, all'), array('name' => 'revisit-after', 'content' => '1 days'), array('name' => 'language', 'content' => 'Vietnamese'), array('name' => 'dc.creator.email', 'content' => '[email protected]'), array('name' => 'dc.identifier', 'content' => base_url()), array('name' => 'dc.language', 'content' => 'vi-VN'), array('name' => 'og:type', 'content' => 'article'), array('name' => 'og:title', 'content' => 'Phòng khám đa khoa Apollo'), array('name' => 'geo.position', 'content' => '20.995733, 105.842902'), array('name' => 'geo.placename', 'content' => 'TP.HCM, Hà Nội'), array('name' => 'geo.region', 'content' => 'VN-65'));
    $meta_properties = "<meta property='og:type' content='article' />\n";
    $meta_properties .= "<meta property='og:title' content='Phòng khám đa khoa Apollo' />\n";
    $meta_properties .= "<meta property='og:description' content='Phòng Khám Đa Khoa apollo với các thiết bị y tế hiện đại, phong cách phục vụ chuyên nghiệp hy vọng sẽ góp phần giúp cho tất cả mọi người luôn có một sức khỏe tốt. />\n";
    $meta_properties .= "<meta property='og:url' content='" . base_url() . "' />\n";
    $meta_properties .= "<meta property='og:sitename' content='Phòng Khám Đa Khoa APOLLO' />";
    $meta_itemprop = "<meta itemprop='name' content='Phòng khám đa khoa Apollo' />\n";
    $meta_itemprop .= "<meta itemprop='description' content='Phòng Khám Đa Khoa apollo với các thiết bị y tế hiện đại, phong cách phục vụ chuyên nghiệp hy vọng sẽ góp phần giúp cho tất cả mọi người luôn có một sức khỏe tốt.' />\n";
    $xhtml_meta = meta($meta) . $meta_properties . $meta_itemprop;
    return $xhtml_meta;
}
开发者ID:pkapollo,项目名称:phongkhamapollo.com,代码行数:17,代码来源:page_helper.php


示例16: test

 public function test()
 {
     echo "Installation check:\n";
     if ($this->exists()) {
         echo "OK: Company data table exists.\n";
     } else {
         echo "ERROR: Company data table does not exists.\n";
     }
     if (meta('company_category')->exists()) {
         echo "OK: Company category table exists.\n";
     } else {
         echo "ERROR: Company category table does not exists.\n";
     }
 }
开发者ID:thruthesky,项目名称:backend,代码行数:14,代码来源:Controller.php


示例17: metas

/**
 * Gets all custom fields within a certain page or post and parses them out into an array
 * with +meta()+
 * 
 * Example:
 *  a post with the following custom fields/values:
 *    key = options, value = 'sort=asc&show_link=1'
 *    key = subtitle, value = 'my subtitle'
 *    key = image, value = 'image01.jpg'
 *    key = image, value = 'image02.jpg'
 * 
 * when run with +metas()+ would produce:
 *  
 *    array(
 *      'options' => array('sort' => 'asc', 'show_link' => 1), 
 *      'images' => array('image01.jpg', 'image02.jpg'),
 *      'subtitle' => 'my subtitle')
 * 
 * @return array  on array of all custom fields *except those beginning with an underscore* (those are considered private)
 */
function metas()
{
    global $post;
    $_ = array();
    if ($keys = get_post_custom_keys($post->ID)) {
        foreach ($keys as $index => $key) {
            if (substr($key, 0, 1) == '_') {
                continue;
            }
            // ignore _key's as those are wordpress-specific
            $_[$key] = meta($key);
        }
    }
    return $_;
}
开发者ID:robhurring,项目名称:better_metas,代码行数:35,代码来源:better_meta.php


示例18: deleteAllCategory

 public function deleteAllCategory()
 {
     $category = meta('company_category');
     $cats = $category->loadQuery();
     if ($cats) {
         foreach ($cats as $cat) {
             $id = $cat->getRecord('id');
             $file = data()->load(" gid='company-category' AND code='{$id}' ");
             if ($file) {
                 $file->delete();
             }
             $cat->delete();
         }
     }
 }
开发者ID:thruthesky,项目名称:backend,代码行数:15,代码来源:Install.php


示例19: update

 public function update()
 {
     meta()->set('title', 'FTP Update');
     if (is_object($response = $this->check(true, true))) {
         return $response;
     }
     $config = config('ftp');
     $days = (int) input('days') ?: $config['days_history'];
     if (input('find') === 'true') {
         $files = (new Repository\Ftp())->getRecentFiles($days);
     } else {
         $files = array();
     }
     return self::content('ftp.update', array('config' => $config, 'days' => $days, 'files' => $files, 'processor' => (new Processor\Ftp())->update()));
 }
开发者ID:eusonlito,项目名称:web-deploy,代码行数:15,代码来源:Ftp.php


示例20: bak

    function bak()
    {
        add_action('add_meta_boxes', function () {
            add_meta_box('movie_director', '扩展资料', function ($post) {
                // 创建临时隐藏表单,为了安全
                wp_nonce_field('movie_director_meta_box', 'movie_director_meta_box_nonce');
                // 获取之前存储的值
                $value = get_post_meta($post->ID, '_question_name', true);
                ?>

                <label for="question_name">名称:</label>
                <input type="text" id="question_name" name="question_name" value="<?php 
                echo esc_attr(meta('_question_name', $post->ID));
                ?>
" placeholder="">
                <label for="question_address">地址:</label>
                <input type="text" id="question_address" name="question_address" value="<?php 
                echo esc_attr(meta('_question_address', $post->ID));
                ?>
"
                       placeholder="">
                <?php 
            }, $this->id, 'normal', 'low');
        });
        add_action('save_post', function ($post_id) {
            // 安全检查
            // 检查是否发送了一次性隐藏表单内容(判断是否为第三者模拟提交)
            if (!isset($_POST['movie_director_meta_box_nonce'])) {
                return;
            }
            // 判断隐藏表单的值与之前是否相同
            if (!wp_verify_nonce($_POST['movie_director_meta_box_nonce'], 'movie_director_meta_box')) {
                return;
            }
            // 判断该用户是否有权限
            if (!current_user_can('edit_post', $post_id)) {
                return;
            }
            // 判断 Meta Box 是否为空
            if (!isset($_POST['movie_director'])) {
                return;
            }
            $movie_director = sanitize_text_field($_POST['movie_director']);
            update_post_meta($post_id, '_movie_director', $movie_director);
        });
    }
开发者ID:ycms,项目名称:theme-evo,代码行数:46,代码来源:post_questions.php



注:本文中的meta函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP metaDescription函数代码示例发布时间:2022-05-15
下一篇:
PHP messenger函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap