本文整理汇总了PHP中StringHelper::titleCase方法的典型用法代码示例。如果您正苦于以下问题:PHP StringHelper::titleCase方法的具体用法?PHP StringHelper::titleCase怎么用?PHP StringHelper::titleCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringHelper
的用法示例。
在下文中一共展示了StringHelper::titleCase方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formatCitation
public function formatCitation()
{
$citation = "";
$citation .= $this->formatAuthors() . '. ';
$citation .= $this->year . '. ';
$citation .= StringHelper::sentenceCase($this->title) . '. ';
$citation .= "Di dalam: ";
if ($this->editors) {
$citation .= $this->formatEditors() . ', editor. ';
}
if ($this->book_title) {
$citation .= '<em>' . StringHelper::titleCase($this->book_title) . '</em>; ';
} else {
$citation .= '[Judul buku tidak diketahui]; ';
}
if ($this->pub) {
$citation .= $this->pub_city . ' (' . $this->pub_country . '): ' . $this->pub . '. ';
} else {
$citation .= '[Penerbit tidak diketahui]. ';
}
if ($this->pages) {
$citation .= 'hlm ' . $this->pages . '. ';
} else {
$citation .= '[No halaman tidak diketahui]. ';
}
return $citation;
}
示例2: formatCitation
public function formatCitation()
{
$citation = "";
$citation .= $this->formatAuthors() . '. ';
$citation .= $this->year . '. ';
$citation .= StringHelper::sentenceCase($this->title) . '. ';
$citation .= "Di dalam: ";
if ($this->editors) {
$citation .= $this->formatEditors() . ', editor. ';
}
if ($this->proc_name) {
$citation .= '<em>' . StringHelper::titleCase($this->proc_name) . '</em>; ';
} else {
$citation .= '[Prosiding tidak diketahui]; ';
}
if ($this->con_date != '') {
$citation .= $this->con_date . '; ';
$citation .= $this->con_city . '. ';
} else {
$citation .= '[Waktu dan tempat pertemuan tidak diketahui]. ';
}
if ($this->pub) {
$citation .= $this->pub_city . ' (' . strtoupper($this->pub_country) . '): ' . $this->pub . '. ';
} else {
$citation .= '[Penerbit tidak diketahui]. ';
}
if ($this->pages) {
$citation .= 'hlm ' . $this->pages . '. ';
} else {
$citation .= '[No halaman tidak diketahui]. ';
}
return $citation;
}
示例3: formatCitation
public function formatCitation()
{
$citation = "";
$citation .= $this->formatAuthors() . '. ';
$citation .= $this->year . '. ';
$citation .= StringHelper::sentenceCase($this->title) . '. ';
$citation .= '<em>' . StringHelper::titleCase($this->journal) . '</em>. ';
$citation .= $this->volume;
if ($this->issue != '') {
$citation .= '(' . $this->issue . ')';
}
$citation .= ':' . $this->pages . '.';
if ($this->doi != '') {
$citation .= ' doi:' . $this->doi . '.';
}
return $citation;
}
示例4: formatCitation
public function formatCitation()
{
$citation = "";
$citation .= $this->formatAuthors() . '. ';
$citation .= $this->year . '. ';
$citation .= '<em>' . StringHelper::titleCase($this->title) . '</em>. ';
if ($this->edition) {
$citation .= 'Ed ke-' . filter_var($this->edition, FILTER_SANITIZE_NUMBER_INT) . '. ';
}
if ($this->editors) {
$citation .= $this->formatEditors() . ', editor. ';
}
if ($this->pub) {
$citation .= $this->pub_city . ' (' . strtoupper($this->pub_country) . '): ' . $this->pub . '. ';
} else {
$citation .= '[Penerbit tidak diketahui]. ';
}
return $citation;
}
示例5: createProceeding
public function createProceeding($data)
{
try {
$bookData = WebAPI::searchBookData($data['ISBN'][0]);
} catch (CException $e) {
$bookData = null;
}
$proc = new Proceeding();
$proc->type = $data['type'];
$proc->authors = $data['author'];
$proc->year = $data['issued']['date-parts'][0][0];
$proc->title = $data['title'][0];
$proc->proc_name = StringHelper::titleCase($data['container-title'][0]);
$proc->pages = null;
// sigh. no info available
if ($bookData !== null) {
$proc->pub = $bookData['publisher'];
$city = explode(",", $bookData['city']);
$proc->pub_city = reset($city);
$proc->pub_city = preg_replace("/[^A-Za-z0-9 \\-']/", "", $proc->pub_city);
// additional filtering
$proc->pub_country = WebAPI::searchCityData($proc->pub_city);
// editors, con_date, con_city uses Stanford NER
// sometimes editors in author, sometimes in title~
$combined = $bookData['author'] . ' ' . $bookData['title'];
$ner_result = StringHelper::NER($combined);
$proc->editors = StringHelper::parseNerPerson($ner_result);
$proc->con_date = StringHelper::parseNerDate($ner_result);
$proc->con_city = StringHelper::parseNerLocation($ner_result);
} else {
$proc->pub = $data['publisher'];
}
return $proc;
}