当前位置: 首页>>代码示例>>PHP>>正文


PHP Field::text方法代码示例

本文整理汇总了PHP中Field::text方法的典型用法代码示例。如果您正苦于以下问题:PHP Field::text方法的具体用法?PHP Field::text怎么用?PHP Field::text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Field的用法示例。


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

示例1: test_generates_a_text_field_with_errors

 public function test_generates_a_text_field_with_errors()
 {
     // Having
     Field::setErrors(['name' => ['This is really wrong']]);
     // Expect
     $this->assertTemplate('fields/text_with_errors', Field::text('name'));
 }
开发者ID:helmerdavila,项目名称:html-integration-tests,代码行数:7,代码来源:FieldBuilderTest.php

示例2: _set_up_venues

 /**
  * Set up custom post type for venues
  *
  * @private
  */
 private static function _set_up_venues()
 {
     // Register Venues custom post types
     PostType::make('venue', 'Venues', 'Venue')->set();
     // Define fields for the metabox
     $fields = array(Field::checkbox('active', array('1' => 'Yes')), Field::checkbox('confirmed', array('1' => 'Yes')), Field::text('address', array('title' => 'Address')), Field::text('city', array('title' => 'City')), Field::text('state', array('title' => 'State')), Field::text('postcode', array('title' => 'Postcode')), Field::text('country', array('title' => 'Country')));
     // Add metabox with custom fields
     Metabox::make('Venue details', 'venue')->set($fields);
     // Add venue types custom taxonomy
     Taxonomy::make('venue_type', 'venue', 'Venue Types', 'Venue Type')->set();
 }
开发者ID:xeiter,项目名称:timeplannr,代码行数:16,代码来源:custom_post_types.php

示例3: slhb_set_title

<?php

/*-----------------------------------------------------------------------*/
// Match Custom Post
/*-----------------------------------------------------------------------*/
$match = PostType::make('slhb_match', 'Les matchs', 'match')->set(array('public' => true, 'menu_position' => 20, 'supports' => false, 'rewrite' => false, 'query_var' => false, 'labels' => ['add_new' => 'Ajouter un nouveau match', 'add_item' => 'Ajouter un match', 'all_items' => 'Tous les matchs', 'edit_item' => 'Modifier un match']));
/*-----------------------------------------------------------------------*/
// Match informations
/*-----------------------------------------------------------------------*/
$infos = Metabox::make('Informations du match', $match->get('name'))->set(array(Field::date('match_date', ['title' => 'Date du match']), Field::select('match_team_dom', TeamModel::getTeamsArray()), Field::text('match_team_ext', ['title' => 'Equipe à l\'exterieur']), Field::number('score_dom', ['title' => 'Score de l\'équipe à domicile']), Field::number('score_ext', ['title' => 'Score de l\'équipe extérieur'])));
/*-----------------------------------------------------------------------*/
// Match Defaults Values
/*-----------------------------------------------------------------------*/
function slhb_set_title($post_id, $post, $update)
{
    $dateStr = Meta::get($post_id, 'match_date');
    $title = $dateStr . ' - ' . Meta::get($post_id, 'match_team_dom') . ' - ' . Meta::get($post_id, 'match_team_ext');
    $date = date($dateStr);
    //This temporarily removes filter to prevent infinite loops
    remove_action('save_post_slhb_match', __FUNCTION__);
    wp_update_post(array('ID' => $post_id, 'post_title' => $title, 'match_date' => $date));
    //redo filter
    add_action('save_post_slhb_match', __FUNCTION__, 10, 3);
}
add_action('save_post_slhb_match', 'slhb_set_title', 10, 3);
开发者ID:J0hnRoger,项目名称:SLHB,代码行数:25,代码来源:ct-match.php

示例4:

<?php

$options = Page::make('options', 'Configuration SLHB')->set(['capability' => 'manage_options', 'icon' => 'dashicons-hammer', 'position' => 50, 'tabs' => true]);
// Partenaires Section
$sections[] = Section::make('section-slhb-options', 'Paramètres généraux');
$options->addSections($sections);
$settings['section-slhb-options'] = [Field::collection('logos', ['title' => 'Logos des partenaires']), Field::text('facebook_url', ['title' => 'Url Facebook']), Field::text('gmap_url', ['title' => 'Url vers la page de contact', 'default' => '/infos-utiles'])];
$options->addSettings($settings);
开发者ID:J0hnRoger,项目名称:SLHB,代码行数:8,代码来源:options.php

示例5: get_page_by_path

<?php

$infosPratiques = get_page_by_path('infos-pratiques');
if (themosis_is_post($infosPratiques->ID)) {
    /*-----------------------------------------------------------------------*/
    // TEAM METABOX
    /*-----------------------------------------------------------------------*/
    Metabox::make('Team', 'page')->set(array(Field::infinite('collaborators', array(Field::text('full-name', array('title' => 'Full name')), Field::text('job'), Field::media('pic')), array('title' => 'Collaborateurs'))));
}
开发者ID:J0hnRoger,项目名称:SLHB,代码行数:9,代码来源:infos-pratiques-admin.php

示例6: __

<?php

$page = Page::make('theme-option', 'Option du theme')->set();
$sections = [Section::make('theme-option-general', __('General', THEME_TEXT_DOMAIN)), Section::make('theme-option-info', __("Society Information", THEME_TEXT_DOMAIN)), Section::make('theme-option-social', __("Social Network", THEME_TEXT_DOMAIN)), Section::make('theme-option-custom-code', __('Code', THEME_TEXT_DOMAIN)), Section::make('theme-option-analytic', __('Analytics', THEME_TEXT_DOMAIN)), Section::make('theme-option-image', __('Default Images', THEME_TEXT_DOMAIN))];
$settings = ['theme-option-general' => [Field::text('name', ['title' => __('Name', THEME_TEXT_DOMAIN)]), Field::text('separator', ['title' => __('Title separator', THEME_TEXT_DOMAIN), 'default' => '-']), Field::select('seplocation', [['right' => __("Right", THEME_TEXT_DOMAIN), 'left' => __("Left", THEME_TEXT_DOMAIN)]], ['title' => __("Title separator emplacement", THEME_TEXT_DOMAIN), 'default' => 'right']), Field::checkbox('showAuthor', ['activate' => 'Afficher l\'auteur'])], 'theme-option-custom-code' => [Field::textarea('javascript', ['title' => __('Javascript', THEME_TEXT_DOMAIN)], ['id' => 'javascript-editor', "class" => "hidden"]), Field::textarea('style', ['title' => __('Style', THEME_TEXT_DOMAIN)], ['id' => 'style-editor', "class" => "hidden"])], 'theme-option-info' => [Field::text('name', ['title' => __('Name', THEME_TEXT_DOMAIN)]), Field::textarea('biography', ['title' => __('Biography', THEME_TEXT_DOMAIN)]), Field::text('address', ['title' => __('Address', THEME_TEXT_DOMAIN)]), Field::text('phoneNumberPrimary', ['title' => __('Phone Number', THEME_TEXT_DOMAIN)], ['type' => 'tel']), Field::text('phoneNumberSecondary', ['title' => __('Phone Number', THEME_TEXT_DOMAIN)], ['type' => 'tel']), Field::text('emailPrimary', ['title' => __('Phone Number', THEME_TEXT_DOMAIN)], ['type' => 'email']), Field::text('emailSecondary', ['title' => __('Phone Number', THEME_TEXT_DOMAIN)], ['type' => 'email'])], 'theme-option-analytic' => [], 'theme-option-social' => [Field::text('facebook', ['title' => 'Facebook'], ['type' => 'url']), Field::text('twitter', ['title' => 'Twitter'], ['type' => 'url']), Field::text('google-plus', ['title' => 'Google plus'], ['type' => 'url']), Field::text('linkedin', ['title' => 'linkedIn'], ['type' => 'url']), Field::text('youtube', ['title' => 'YouTube'], ['type' => 'url']), Field::text('vkontakte', ['title' => 'Vkontakte'], ['type' => 'url']), Field::text('instagram', ['title' => 'Instagram'], ['type' => 'url']), Field::text('rss', ['title' => 'Feed'])], 'theme-option-image' => [Field::media('favicon', ['title' => __("Favicon", THEME_TEXT_DOMAIN)]), Field::media('logo', ['title' => __("Logo", THEME_TEXT_DOMAIN)])]];
$validation = ['name' => ['min:3', 'textfield'], 'facebook' => ['url'], 'twitter' => ['url'], 'google-plus' => ['url'], 'linkedin' => ['url'], 'youtube' => ['url'], 'vkontakte' => ['url'], 'Instagram' => ['url'], 'rss' => ['url']];
$page->addSections($sections);
$page->addSettings($settings);
$page->validate($validation);
开发者ID:andrijdavid,项目名称:MyTheme,代码行数:9,代码来源:options.php

示例7: __

<?php

$cat = Taxonomy::make('product-category', 'products', __('Product Categories', THEME_TEXT_DOMAIN), __('Product Category', THEME_TEXT_DOMAIN))->set(['public' => true, 'show_in_nav_menus' => true, 'hierarchical' => true, 'show_tagcloud' => true, 'show_in_quick_edit' => true]);
$tag = Taxonomy::make('product-tag', 'products', __('Product Tags', THEME_TEXT_DOMAIN), __('Product Tag', THEME_TEXT_DOMAIN))->set(['public' => true, 'show_in_nav_menus' => true, 'hierarchical' => true, 'show_tagcloud' => true, 'show_in_quick_edit' => true]);
$products = PostType::make('products', __('Products', THEME_TEXT_DOMAIN), __('Product', THEME_TEXT_DOMAIN))->set(['public' => true, 'labels' => ['add_item' => __('Add', THEME_TEXT_DOMAIN)], 'supports' => array('title', 'excerpt', 'thumbnail', 'revisions'), 'taxonomies' => array('product-category', 'product-tag')]);
$infos = Metabox::make('Informations', $products->getSlug())->set(array(Field::textarea('description'), Field::collection('images', ['type' => 'images']), Field::infinite('info', [Field::text('title'), Field::textarea('value')])));
/*-----------------------------------------------------------------------*/
// Book info validation
/*-----------------------------------------------------------------------*/
$infos->validate(array());
开发者ID:andrijdavid,项目名称:MyTheme,代码行数:10,代码来源:product.php

示例8: array

<?php

/*-----------------------------------------------------------------------*/
// Custom post type - bks-books
/*-----------------------------------------------------------------------*/
$books = PostType::make('bks-books', 'Books', 'Book')->set(array('public' => true, 'rewrite' => array('slug' => 'books'), 'supports' => array('title', 'editor', 'excerpt', 'thumbnail')));
/*-----------------------------------------------------------------------*/
// Book informations
/*-----------------------------------------------------------------------*/
$infos = Metabox::make('Informations', $books->getSlug())->set(array(Field::text('author'), Field::media('promo-image', array('title' => 'Image promotion', 'info' => 'Image used on home page in order to promote the book.')), Field::text('color', array('info' => 'Insert a hexadecimal color value: <b>#cdcdcd</b>'))));
/*-----------------------------------------------------------------------*/
// Book info validation
/*-----------------------------------------------------------------------*/
$infos->validate(array('author' => array('textfield', 'min:5'), 'color' => array('color')));
开发者ID:johnulist,项目名称:bookstore,代码行数:14,代码来源:books.php

示例9:

<?php

/**
 * application.php - Write your custom code below.
 */
require_once 'custom_post_types.php';
Custom_Post_Types::set_up();
// Define custom user meta data
User::addFields([Field::text('telegram_api_token', ['title' => 'Telegram API token'])]);
开发者ID:xeiter,项目名称:timeplannr,代码行数:9,代码来源:application.php

示例10: add_action

<?php

/*
  Plugin Name: Test Plugin
 */
require_once 'test-project/themosis.php';
add_action('init', function () {
    \Themosis\Facades\Metabox::make('Details', 'post')->set([Field::text('name'), Field::checkbox('channels', ['email', 'mail', 'morse'])]);
});
开发者ID:mithublue,项目名称:test-plugin,代码行数:9,代码来源:test-plugin.php


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