本文整理汇总了PHP中Croogo::getRelativePath方法的典型用法代码示例。如果您正苦于以下问题:PHP Croogo::getRelativePath方法的具体用法?PHP Croogo::getRelativePath怎么用?PHP Croogo::getRelativePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Croogo
的用法示例。
在下文中一共展示了Croogo::getRelativePath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getNodeRelativePath
/**
* getNodeRelativePath
*
* @param array $node Node array
* @return string relative node path
*/
protected function _getNodeRelativePath($node)
{
return Croogo::getRelativePath(array('plugin' => 'nodes', 'admin' => false, 'controller' => 'nodes', 'action' => 'view', 'type' => $this->_getType($node), 'slug' => $node[$this->alias]['slug']));
}
示例2: admin_update_paths
/**
* Admin update paths
*
* @return void
* @access public
*/
public function admin_update_paths()
{
$types = $this->Node->Taxonomy->Vocabulary->Type->find('list', array('fields' => array('Type.id', 'Type.alias')));
$typesAlias = array_values($types);
$nodes = $this->Node->find('all', array('conditions' => array('Node.type' => $typesAlias), 'fields' => array('Node.id', 'Node.slug', 'Node.type', 'Node.path'), 'recursive' => '-1'));
foreach ($nodes as $node) {
$node['Node']['path'] = Croogo::getRelativePath(array('admin' => false, 'controller' => 'nodes', 'action' => 'view', 'type' => $node['Node']['type'], 'slug' => $node['Node']['slug']));
$this->Node->id = false;
$this->Node->save($node);
}
$this->Session->setFlash(__('Paths updated.'), 'default', array('class' => 'success'));
$this->redirect(array('action' => 'index'));
}
示例3: getRelativePath
/**
* Get URL relative to the app
*
* @param array $url
* @return array
* @deprecated Use Croogo::getRelativePath
*/
public function getRelativePath($url = '/')
{
return Croogo::getRelativePath($url);
}