本文整理汇总了PHP中Format::apply方法的典型用法代码示例。如果您正苦于以下问题:PHP Format::apply方法的具体用法?PHP Format::apply怎么用?PHP Format::apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Format
的用法示例。
在下文中一共展示了Format::apply方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_init_theme
public function action_init_theme()
{
Format::apply('tag_and_list', 'post_tags_out', ', ', ', ');
Format::apply_with_hook_params('more', 'post_content_out', 'More ›', null, 1);
Stack::add('template_stylesheet', array(Site::get_url('theme') . '/css/screen.css', 'screen, projection'), 'screen');
Stack::add('template_stylesheet', array(Site::get_url('theme') . '/css/style.css', 'screen, projection'), 'style');
}
示例2: test_format_priority
public function test_format_priority()
{
Format::apply(function ($v) {
return $v . '7';
}, 'test_filter_7');
Format::apply(function ($v) {
return $v . '8';
}, 'test_filter');
$result = Plugins::filter('test_filter', 'test');
$this->assert_equal('test78', $result);
Format::apply(function ($v, $c) {
return $v . '7' . $c;
}, 'test_filter2_7', 'a');
Format::apply(function ($v, $c) {
return $v . '8' . $c;
}, 'test_filter2', 'b');
$result = Plugins::filter('test_filter2', 'test');
$this->assert_equal('test7a8b', $result);
Format::apply_with_hook_params(function ($v, $h, $c) {
return $v . '7' . $h . $c;
}, 'test_filter3_7', 'a');
Format::apply_with_hook_params(function ($v, $h, $c) {
return $v . '8' . $h . $c;
}, 'test_filter3', 'b');
$result = Plugins::filter('test_filter3', 'test', 'h');
$this->assert_equal('test7ha8hb', $result);
}
示例3: action_init_theme
public function action_init_theme()
{
// Apply Format::autop() to post content:
Format::apply('autop', 'post_content_out');
// Apply Format::autop() to comment content:
Format::apply('autop', 'comment_content_out');
/*DELETE ME
Format::apply( 'nice_date', 'post_updated_date', 'F j, Y' );
Format::apply( 'nice_date', 'post_updated_time', 'g:ia' );
Format::apply( 'nice_date', 'post_pubdate_wday', 'l' );
Format::apply( 'nice_date', 'post_pubdate_day', 'j' );
Format::apply( 'nice_date', 'post_pubdate_month', 'F' );
Format::apply( 'nice_date', 'post_pubdate_monthno', 'm' );
Format::apply( 'nice_date', 'post_pubdate_year', 'Y' );
Format::apply( 'nice_date', 'post_pubdate_time', 'g:ia' );
// Apply Format::nice_date() to comment date:
Format::apply( 'nice_date', 'comment_date', 'F j, Y' );
Format::apply( 'nice_date', 'comment_time', 'g:ia' );
/DELETEME */
// Apply Format::tag_and_list() to post tags...
Format::apply('tag_and_list', 'post_tags_out');
// Truncate content excerpt at "more" or 56 characters:
//Format::apply_with_hook_params( 'more', 'post_content_excerpt','',600, 0 );
//Initial options
$configured = Options::get('darkautumn__configured') ? true : false;
if (!$configured) {
$this->set_default_options();
}
}
示例4: action_init_theme
/**
* Execute on theme init to apply these filters to output
*/
public function action_init_theme()
{
// Apply Format::autop() to comment content...
Format::apply('autop', 'comment_content_out');
// Truncate content excerpt at "more" or 56 characters...
Format::apply('autop', 'post_content_excerpt');
Format::apply_with_hook_params('more', 'post_content_excerpt', '', 56, 1);
}
示例5: action_init_theme
/**
* Execute on theme init to apply these filters to output
*/
public function action_init_theme()
{
// Apply Format::autop() to comment content...
Format::apply('autop', 'comment_content_out');
// Truncate content excerpt at "more" or 56 characters...
Format::apply('autop', 'post_content_excerpt');
Format::apply_with_hook_params('more', 'post_content_excerpt', '', 56, 1);
// Add FormUI template placing the input before the label
$this->add_template('charcoal_text', dirname(__FILE__) . '/formcontrol_text.php');
}
示例6: action_init_theme
public function action_init_theme()
{
// Apply Format::autop() to post content...
Format::apply('autop', 'post_content_out');
// Apply Format::autop() to comment content...
Format::apply('autop', 'comment_content_out');
// Apply Format::tag_and_list() to post tags...
Format::apply('tag_and_list', 'post_tags_out');
// Apply Format::nice_date() to post date...
Format::apply('nice_date', 'post_pubdate_out', 'F jS, Y');
}
示例7: action_init_theme
public function action_init_theme()
{
$this->load_text_domain('sp');
// Apply Format::autop() to comment content.
Format::apply('autop', 'comment_content_out');
// Apply Format::tag_and_list() to post tags...
Format::apply('tag_and_list', 'post_tags_out');
// Only triggered by <!--more--> tag, not by length.
Format::apply_with_hook_params('more', 'post_content_out', _t('--More--', 'sp'));
// Excerpt output. echo $post->content_excerpt.
Format::apply_with_hook_params('more', 'post_content_excerpt', _t('--More--', 'sp'), 60, 1);
}
示例8: action_init_theme
public function action_init_theme()
{
// Apply Format::autop() to comment content...
Format::apply('autop', 'comment_content_out');
// Apply Format::tag_and_list() to post tags...
Format::apply('tag_and_list', 'post_tags_out');
// Only uses the <!--more--> tag, with the 'more' as the link to full post
Format::apply_with_hook_params('more', 'post_content_out', 'more');
// Creates an excerpt option. echo $post->content_excerpt;
Format::apply('autop', 'post_content_excerpt');
Format::apply_with_hook_params('more', 'post_content_excerpt', 'more', 60, 1);
$this->autoCompileLess(dirname(__FILE__) . "/less/bootstrap.less", dirname(__FILE__) . "/css/bootstrap.css");
$this->autoCompileLess(dirname(__FILE__) . "/less/custom.less", dirname(__FILE__) . "/css/custom.css");
}
示例9: action_init_theme
/**
* Execute on theme init to apply these filters to output
*/
public function action_init_theme()
{
if (!Plugins::is_loaded('HabariMarkdown')) {
// Apply Format::autop() to post content...
Format::apply('autop', 'post_content_out');
}
// Truncate content excerpt at "<!--more-->"...
Format::apply_with_hook_params('more', 'post_content_out');
// Apply Format::autop() to comment content...
Format::apply('autop', 'comment_content_out');
// Apply Format::tag_and_list() to post tags...
Format::apply('tag_and_list', 'post_tags_out');
$this->load_text_domain('demorgan');
}
示例10: action_init_theme
public function action_init_theme()
{
// Apply Format::autop() to comment content...
Format::apply( 'autop', 'comment_content_out' );
// Apply Format::tag_and_list() to post tags...
Format::apply( 'tag_and_list', 'post_tags_out' );
// Only uses the <!--more--> tag, with the 'more' as the link to full post
Format::apply_with_hook_params( 'more', 'post_content_out', 'more' );
// Creates an excerpt option. echo $post->content_excerpt;
Format::apply( 'autop', 'post_content_excerpt' );
Format::apply_with_hook_params( 'more', 'post_content_excerpt', 'more',60, 1 );
// Format the calendar like date for home, entry.single and entry.multiple templates
Format::apply( 'format_date', 'post_pubdate_out','<span class="calyear">{Y}</span><br><span class="calday">{j}</span><br><span class="calmonth">{F}</span>' );
}
示例11: action_init
public function action_init()
{
if (!class_exists('MarkdownExtra')) {
require_once 'php-markdown/Michelf/Markdown.php';
require_once 'php-markdown/Michelf/MarkdownExtra.php';
}
if (!function_exists('SmartyPants') && Options::get('habarimarkdown__smarty', false)) {
require_once 'php-smartypants/smartypants.php';
}
Format::apply('markdown', 'post_content_out_7');
Format::apply('markdown', 'post_content_summary_7');
Format::apply('markdown', 'post_content_more_7');
Format::apply('markdown', 'post_content_excerpt_7');
Format::apply('comment_safe_markdown', 'comment_content_out_7');
}
示例12: action_init_theme
/**
* Execute on theme init to apply these filters to output
*/
public function action_init_theme()
{
// Apply Format::autop() to post content...
Format::apply('autop', 'post_content_out');
Format::apply('autop', 'post_content_excerpt');
// Apply Format::autop() to comment content...
Format::apply('autop', 'comment_content_out');
// Apply Format::tag_and_list() to post tags...
Format::apply('tag_and_list', 'post_tags_out');
// Apply Format::nice_date() to post date...
Format::apply('nice_date', 'post_pubdate_out', 'F j, Y g:ia');
// Apply Format::nice_date() to comment date...
Format::apply('nice_date', 'comment_date_out', 'F j, Y g:ia');
// Truncate content excerpt at "more" or 75 characters...
Format::apply_with_hook_params('more', 'post_content_excerpt', 'Read More', 75);
}
示例13: action_init_theme
/**
* Add default output filters
**/
public function action_init_theme()
{
// Apply Format::autop() to post content...
Format::apply('autop', 'post_content_out');
// Apply Format::autop() to comment content...
Format::apply('autop', 'comment_content_out');
// Apply Format::tag_and_list() to post tags...
Format::apply('tag_and_list', 'post_tags_out');
// Apply Format::nice_date() to post date...
Format::apply('format_date', 'post_pubdate_out', '{F} {j}, {Y} {g}:{i}{a}');
// Apply Format::more to post content...
Plugins::register(array($this, 'more'), 'filter', 'post_content_out');
// Apply Format::search_highlight to post content...
Format::apply('search_highlight', 'post_content_out');
//Session::error('Sample error', 'sample');
}
示例14: action_init_theme
public function action_init_theme()
{
// Apply Format::autop() to post content...
Format::apply('autop', 'post_content_out');
// Only uses the <!--more--> tag, with the 'more' as the link to full post
Format::apply_with_hook_params('more', 'post_content_out', 'more');
// Creates an excerpt option. echo $post->content_excerpt;
Format::apply_with_hook_params('more', 'post_content_excerpt', 'more', 60, 1);
// Apply Format::autop() to comment content...
Format::apply('autop', 'comment_content_out');
// Apply Format::tag_and_list() to post tags...
Format::apply('tag_and_list', 'post_tags_out');
// Apply Format::nice_date() to comment date...
Format::apply('nice_date', 'comment_date_out', 'F jS, Y');
// Apply Format::nice_date() to post date...
Format::apply('nice_date', 'post_pubdate_out', 'F jS, Y');
}
示例15: action_init_theme
/**
* Execute on theme init to apply these filters to output
*/
public function action_init_theme()
{
// Apply Format::autop() to post content
Format::apply('autop', 'post_content_out');
// Apply Format::autop() to comment content
Format::apply('autop', 'comment_content_out');
// Apply Format::nice_date() to post date...
Format::apply('nice_date', 'post_pubdate_out', 'j-M-Y');
// Apply Format::nice_date() to post date time...
Format::apply('nice_date', 'post_pubdate_time', '\\a\\t g:ia');
// Apply Format::nice_date() to post date excerpt...
Format::apply('nice_date', 'post_pubdate_excerpt', 'l, F jS, Y');
// Apply Format::nice_date() to comment date...
//Format::apply( 'nice_date', 'comment_date', 'l, F jS, Y \a\t g:ia' );
// Truncate content excerpt at "more" or 56 characters...
Format::apply_with_hook_params('more', 'post_content_excerpt', '', 256, 1);
}