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


PHP MultiByte::ucwords方法代码示例

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


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

示例1: setup_admin_theme

 /**
  * Create the admin theme instance
  *
  * @param string $page The admin page requested
  * @param string $type The content type included in the request
  */
 public function setup_admin_theme($page, $type = '')
 {
     if (!isset($this->theme)) {
         $theme_dir = Plugins::filter('admin_theme_dir', Site::get_dir('admin_theme', true));
         $this->theme = Themes::create('_admin', 'RawPHPEngine', $theme_dir);
         // Add some default template variables
         $this->set_admin_template_vars($this->theme);
         $this->theme->admin_type = $type;
         $this->theme->admin_page = $page;
         $this->theme->admin_page_url = $page == 'dashboard' ? URL::get('admin', 'page=') : URL::get('admin', 'page=' . $page);
         $this->theme->page = $page;
         $this->theme->admin_title = MultiByte::ucwords($page) . ($type != '' ? ' ' . MultiByte::ucwords($type) : '');
         $this->theme->admin_title = isset($this->theme->mainmenu[$this->theme->admin_page]['text']) ? $this->theme->mainmenu[$this->theme->admin_page]['text'] : MultiByte::ucwords($page) . ($type != '' ? ' ' . MultiByte::ucwords($type) : '');
     }
 }
开发者ID:wwxgitcat,项目名称:habari,代码行数:21,代码来源:adminhandler.php

示例2: test_ucwords

 public function test_ucwords()
 {
     $this->assert_equal(MultiByte::ucwords($this->test_strings['lowercase_sentence']), $this->test_strings['ucwords_sentence']);
 }
开发者ID:habari,项目名称:tests,代码行数:4,代码来源:test_multibyte.php

示例3: testUcwords

	public function testUcwords ( ) {
		
		$this->assertEquals( MultiByte::ucwords( $this->test_strings['lowercase_sentence'] ), $this->test_strings['ucwords_sentence'] );
		
		// perform a single test with an ascii string for code coverage
		$this->assertEquals( MultiByte::ucwords( 'cows go moo', 'ascii' ), 'Cows Go Moo' );
		
	}
开发者ID:rick-c,项目名称:tests,代码行数:8,代码来源:multiByteTest.php

示例4: generate_title

 private function generate_title($min = 2, $max = 8)
 {
     // get a fake paragraph of text that's 1 line long
     $text = $this->generate_paragraph(1, 1);
     $text = MultiByte::strtolower($text);
     // remove commas and periods
     $text = MultiByte::str_replace(array('.', ','), '', $text);
     $words = explode(' ', $text);
     // randomize the words list
     shuffle($words);
     // we can only get the max number of words the paragraph generated
     if ($min > count($words)) {
         $min = count($words);
     }
     if ($max > count($words)) {
         $max = count($words);
     }
     // decide how many words we want
     $how_many_words = mt_rand($min, $max);
     $title = array();
     for ($i = 0; $i < $how_many_words; $i++) {
         // snag a random word
         $title[] = array_pop($words);
     }
     $title = implode(' ', $title);
     // capitalize the first letter of each word
     $title = MultiByte::ucwords($title);
     return $title;
 }
开发者ID:habari-extras,项目名称:Lipsum,代码行数:29,代码来源:lipsum.plugin.php

示例5: setup_admin_theme

	/**
	 * Create the admin theme instance
	 *
	 * @param string $page The admin page requested
	 * @param string $type The content type included in the request
	 */
	public function setup_admin_theme( $page, $type = '' )
	{
		if ( !isset( $this->theme ) ) {
			$theme_dir = Plugins::filter( 'admin_theme_dir', Site::get_dir( 'admin_theme', true ) );
			$this->theme = Themes::create( 'admin', 'RawPHPEngine', $theme_dir );

			// Add some default stylesheets
			Stack::add( 'admin_stylesheet', array( Site::get_url( 'admin_theme' ) . '/css/admin.css', 'screen' ), 'admin' );
			Stack::add( 'admin_stylesheet', array( Site::get_url( 'admin_theme' ) . '/css/jqueryui.css', 'screen' ), 'jqueryui' );

			// Add some default template variables
			$this->set_admin_template_vars( $this->theme );
			$this->theme->admin_type = $type;
			$this->theme->admin_page = $page;
			$this->theme->admin_page_url = ( $page == 'dashboard' ) ? URL::get( 'admin', 'page=' ) : URL::get( 'admin', 'page=' . $page );
			$this->theme->page = $page;
			$this->theme->admin_title = MultiByte::ucwords( $page ) . ( $type != '' ? ' ' . MultiByte::ucwords( $type ) : '' );
			$this->theme->admin_title =
				isset( $this->theme->mainmenu[$this->theme->admin_page]['text'] )
					? $this->theme->mainmenu[$this->theme->admin_page]['text']
					: MultiByte::ucwords( $page ) . ( $type != '' ? ' ' . MultiByte::ucwords( $type ) : '' );
		}
	}
开发者ID:rynodivino,项目名称:system,代码行数:29,代码来源:adminhandler.php


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