本文整理匯總了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);
}