本文整理汇总了PHP中Path::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Path::save方法的具体用法?PHP Path::save怎么用?PHP Path::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Path
的用法示例。
在下文中一共展示了Path::save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _set_front_page
/**
* Sets Front page route
*
* @param string $source Path for alias
* @return ORM Model_Path
*
* @uses Path::delete
* @uses Path::save
*/
private function _set_front_page($source)
{
// Delete previous alias if any
Path::delete(array('alias' => Path::FRONT_ALIAS));
// Create and save alias
$values = array();
$values['source'] = $source;
$values['alias'] = Path::FRONT_ALIAS;
return Path::save($values);
}
示例2: aliases
/**
* Adds or deletes path aliases
*
* @uses Module::action
* @uses Path::load
* @uses Path::save
*/
protected function aliases()
{
// Create and save alias for the post
$values = array();
$path = Path::load($this->rawurl);
if ($path) {
$values['id'] = (int) $path['id'];
}
$alias = empty($this->path) ? $this->_object_plural . '/' . $this->title : $this->path;
$values['source'] = $this->rawurl;
$values['alias'] = Path::clean($alias);
$values['type'] = NULL;
$values['action'] = empty($this->action) ? $this->type : $this->action;
$values = Module::action('post_aliases', $values, $this);
Path::save($values);
}
示例3: _aliases
/**
* Adds or deletes path aliases
*
* @uses Path::load
* @uses Path::clean
* @uses Module::action
*/
private function _aliases()
{
// Create and save alias for the post
$values = array();
$path = Path::load($this->rawurl);
if ($path) {
$values['id'] = (int) $path['id'];
}
$alias = empty($this->path) ? 'category/' . $this->name : $this->path;
$values['source'] = $this->rawurl;
$values['alias'] = Path::clean($alias);
$values['type'] = $this->type;
$values['action'] = empty($this->action) ? 'category' : $this->action;
$values = Module::action('term_aliases', $values, $this);
Path::save($values);
}