本文整理汇总了PHP中text::title方法的典型用法代码示例。如果您正苦于以下问题:PHP text::title方法的具体用法?PHP text::title怎么用?PHP text::title使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类text
的用法示例。
在下文中一共展示了text::title方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Get newsfeed item as HTML
*
* @param Newsfeed_Model $item
* @return string
*/
public static function get(NewsFeedItem_Model $item)
{
$text = '';
switch ($item->type) {
case self::TYPE_COMMENT:
$gallery = new Gallery_Model($item->data['gallery_id']);
$image = new Image_Model($item->data['image_id']);
if ($gallery->loaded() && $image->loaded()) {
$text = __('commented to an image in :gallery', array(':gallery' => html::anchor(url::model($gallery) . '/' . $image->id, text::title($gallery->name), array('title' => $gallery->name))));
}
break;
}
return $text;
}
示例2: get
/**
* Get newsfeed item as HTML
*
* @param Newsfeed_Model $item
* @return string
*/
public static function get(NewsFeedItem_Model $item)
{
$text = '';
switch ($item->type) {
case self::TYPE_COMMENT:
$entry = new Blog_Entry_Model($item->data['entry_id']);
if ($entry->id) {
$text = __('commented to blog :blog', array(':blog' => html::anchor(url::model($entry), text::title($entry->name), array('title' => $entry->name))));
}
break;
case self::TYPE_ENTRY:
$entry = new Blog_Entry_Model($item->data['entry_id']);
if ($entry->id) {
$text = __('wrote a new blog entry :blog', array(':blog' => html::anchor(url::model($entry), text::title($entry->name), array('title' => $entry->name))));
}
break;
}
return $text;
}
示例3: get
/**
* Get newsfeed item as HTML
*
* @param Newsfeed_Model $item
* @return string
*/
public static function get(NewsFeedItem_Model $item)
{
$text = '';
switch ($item->type) {
case self::TYPE_EVENT:
$event = new Event_Model($item->data['event_id']);
if ($event->id) {
$text = __('added new event :event', array(':event' => html::anchor(url::model($event), text::title($event->name), array('title' => $event->name))));
}
break;
case self::TYPE_FAVORITE:
$event = new Event_Model($item->data['event_id']);
if ($event->id) {
$text = __('added event :event to favorites', array(':event' => html::anchor(url::model($event), text::title($event->name), array('title' => $event->name))));
}
break;
}
return $text;
}
示例4: get
/**
* Get newsfeed item as HTML
*
* @param Newsfeed_Model $item
* @return string
*/
public static function get(NewsFeedItem_Model $item)
{
$text = '';
switch ($item->type) {
case self::TYPE_REPLY:
$topic = new Forum_Topic_Model($item->data['topic_id']);
if ($topic->id) {
$text = __('replied to topic :topic', array(':topic' => html::anchor(url::model($topic) . '/page/last#last', text::title($topic->name), array('title' => $topic->name))));
}
break;
case self::TYPE_TOPIC:
$topic = new Forum_Topic_Model($item->data['topic_id']);
if ($topic->id) {
$text = __('started a new topic :topic', array(':topic' => html::anchor(url::model($topic), text::title($topic->name), array('title' => $topic->name))));
}
break;
}
return $text;
}
示例5: role
/**
* Single role view
*
* @param string $role_id
* @param string $action
*/
public function role($role_id, $action = null)
{
if ($action) {
switch ($action) {
// Delete role
case 'delete':
$this->_role_delete($role_id);
return;
}
}
$this->history = false;
$role = new Role_Model((int) $role_id);
$form_values = $role->as_array();
$form_errors = $errors = array();
// Check post
if ($post = $this->input->post()) {
$role->name = $post['name'];
$role->description = $post['description'];
try {
$role->save();
url::redirect('/roles');
} catch (ORM_Validation_Exception $e) {
$form_errors = $e->validation->errors();
}
$form_values = arr::overwrite($form_values, $post);
}
// show form
if ($role->id) {
$this->breadcrumb[] = html::anchor('role/' . url::title($role->id, $role->name), html::specialchars($role->name));
$this->page_title = text::title($role->name);
$this->page_actions[] = array('link' => 'role/' . url::title($role->id, $role->name) . '/delete', 'text' => __('Delete role'), 'class' => 'role-delete');
} else {
$this->page_title = __('Role');
}
if (empty($errors)) {
widget::add('main', View_Mod::factory('roles/role_edit', array('values' => $form_values, 'errors' => $form_errors)));
} else {
$this->_error(Kohana::lang('generic.error'), $errors);
}
}
示例6: _entry_edit
/**
* Edit entry
*
* @param integer|string $entry_id
*/
public function _entry_edit($entry_id = false)
{
$this->history = false;
$entry = new Blog_Entry_Model((int) $entry_id);
// For authenticated users only
if (!$this->user || !$entry->is_author() && !$this->visitor->logged_in('admin')) {
url::redirect(empty($_SESSION['history']) ? '/blogs' : $_SESSION['history']);
}
$errors = $form_errors = array();
$form_messages = '';
$form_values = $entry->as_array();
/***** CHECK POST *****/
if (request::method() == 'post') {
$post = $this->input->post();
// update
$editing = (bool) $entry->id;
if ($editing) {
$extra['modified'] = date::unix2sql(time());
$extra['modifies'] = (int) $entry->modifies + 1;
} else {
$extra['author_id'] = $this->user->id;
}
if ($entry->validate($post, true, $extra)) {
// News feed event
if (!$editing) {
newsfeeditem_blog::entry($this->user, $entry);
}
url::redirect(url::model($entry));
} else {
$form_errors = $post->errors();
$form_messages = $post->message();
}
$form_values = arr::overwrite($form_values, $post->as_array());
}
/***** /CHECK POST *****/
/***** SHOW FORM *****/
if ($entry->id) {
$this->page_actions[] = array('link' => url::model($entry) . '/delete?token=' . csrf::token($this->user->id), 'text' => __('Delete entry'), 'class' => 'entry-delete');
$this->page_title = text::title($entry->name);
$this->page_subtitle = __('Edit entry');
} else {
$this->page_title = __('New entry');
}
$form = $entry->get_form();
if (empty($errors)) {
widget::add('head', html::script(array('js/jquery.markitup.pack.js', 'js/markitup.bbcode.js')));
widget::add('main', View::factory('blog/entry_edit', array('form' => $form, 'values' => $form_values, 'errors' => $form_errors, 'messages' => $form_messages)));
} else {
$this->_error(Kohana::lang('generic.error'), $errors);
}
/***** /SHOW FORM *****/
}
示例7: __
?>
<?php
if ($image->exif->focal) {
?>
<dd><?php
echo __('Focal length: :focal mm', array(':focal' => '<var>' . text::title($image->exif->focal, true)));
?>
</dd>
<?php
}
?>
<?php
if ($image->exif->iso) {
?>
<dd><?php
echo __('ISO speed: :iso', array(':iso' => '<var>' . text::title($image->exif->iso, true)));
?>
</dd>
<?php
}
?>
<?php
if ($image->exif->taken) {
?>
<dd><?php
echo __('Taken: :taken', array(':taken' => '<var>' . date::format('DMYYYY_HM', $image->exif->taken)));
?>
</dd>
<?php
}
?>
示例8: foreach
<?php
}
?>
<?php
foreach ($events as $event) {
?>
<article class="event event-<?php
echo $event->id;
?>
">
<header>
<h4><?php
echo html::anchor(url::model($event), text::title($event->name));
?>
</h4>
</header>
<?php
if ($event->price !== null && $event->price != -1) {
?>
<span class="details price"><?php
echo $event->price == 0 ? __('Free entry') : '<var>' . format::money($event->price, $event->country->currencycode) . '</var>';
?>
</span>
<?php
}
?>
示例9: foreach
?>
<ul>
<?php
foreach ($galleries as $gallery) {
?>
<li class="unit size1of2">
<div class="thumb unit size2of5">
<?php
echo html::anchor(url::model($gallery), html::image('http://' . Kohana::config('site.image_server') . '/kuvat/' . $gallery->dir . '/thumb_' . $gallery->default_image->legacy_filename));
?>
</div>
<header>
<h4><?php
echo html::anchor(url::model($gallery), text::title($gallery->name));
?>
</h4>
<span class="details">
<?php
echo html::time(date::format('DMYYYY', $gallery->event_date), $gallery->event_date, true);
?>
,
<?php
echo __2(':images image', ':images images', $gallery->image_count, array(':images' => '<var>' . $gallery->image_count . '</var>'));
?>
</span>
</header>
</li>
<?php
}
示例10: foreach
if (!empty($events)) {
?>
<ul class="events">
<?php
foreach ($events as $event) {
?>
<li class="event event-<?php
echo $event->id;
?>
">
<?php
echo date::format('DDMM', $event->start_time);
?>
<!--<?php
echo html::anchor(url::model($event), text::limit_chars(text::title($event->name), 20, '…', true), array('title' => $event->name));
?>
-->
<?php
echo html::anchor(url::model($event), $event->name);
?>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
示例11: elseif
<?php
} elseif (!$area->is_type(Forum_Area_Model::TYPE_HIDDEN)) {
?>
<article class="area area-<?php
echo $area->id;
?>
disabled">
<header>
<h4>
<span title="<?php
echo strip_tags($area->description);
?>
"><?php
echo text::title($area->name);
?>
</h4>
<?php
echo __('Members only');
?>
</header>
</article>
<?php
}
?>
<?php
}
?>
示例12: _blog
/**
* Blog entries
*/
public function _blog()
{
$this->tab_id = 'blog';
// Basic information
$this->page_title = text::title($this->member->username, false);
$this->_side_views();
}
示例13: foreach
<li class="group">
<h5><?php
echo html::anchor(url::model($group), text::title($group->name));
?>
</h5>
<ul class="areas">
<?php
foreach ($group->forum_areas->find_all() as $area) {
?>
<?php
if ($area->has_access(Forum_Area_Model::ACCESS_READ)) {
?>
<li><?php
echo html::anchor(url::model($area), text::title($area->name), array('title' => strip_tags($area->description)));
?>
</li>
<?php
}
?>
<?php
}
?>
</ul>
</li>
<?php
}
?>
示例14: week
/**
* Week view
*
* @param int $year
* @param int $week
*/
public function week($year, $week)
{
$this->tab_id = 'browse';
if (valid::year($year) && valid::week($week)) {
$this->type = 'week';
$this->date->setISODate($year, $week);
// check for new years fix
if ($week == 1) {
$saturday = new DateTime();
$saturday->setISODate($year, $week, 6);
$this->date = $saturday;
}
$this->page_title = text::title(__('Week') . ' ' . $this->date->format('W/Y'));
$this->breadcrumb[] = html::anchor(Router::$routed_uri, html::specialchars($this->page_title));
$this->_build_calendar();
}
}
示例15: tag
/**
* Show tag
*
* @param intege|string $tag_id
* @param string $action
*/
public function tag($tag_id, $action = null)
{
if ($action) {
switch ($action) {
// Delete tag
case 'delete':
$this->_tag_delete($tag_id);
return;
// Edit tag
// Edit tag
case 'edit':
$this->_tag_edit($tag_id);
return;
}
}
$tag = new Tag_Model((int) $tag_id);
$errors = $tag->id ? array() : array('tags.error_tag_not_found');
if (empty($errors)) {
$tag_group = $tag->tag_group;
$this->breadcrumb[] = html::anchor(url::model($tag_group), $tag_group->name);
$this->breadcrumb[] = html::anchor(url::model($tag), $tag->name);
$this->page_title = text::title($tag->name);
$this->page_subtitle = html::specialchars($tag->description) . ' ';
if ($this->visitor->logged_in('admin')) {
$this->page_actions[] = array('link' => url::model($tag) . '/edit', 'text' => __('Edit tag'), 'class' => 'tag-edit');
}
foreach ($tag->get_defaults() as $key => $field) {
if (!empty($field)) {
widget::add('main', $key . ' = ' . html::specialchars($field) . "<br />\n");
}
}
} else {
$this->_error(Kohana::lang('generic.error'), $errors);
}
$this->_side_views();
}