本文整理汇总了PHP中Navigation::setType方法的典型用法代码示例。如果您正苦于以下问题:PHP Navigation::setType方法的具体用法?PHP Navigation::setType怎么用?PHP Navigation::setType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Navigation
的用法示例。
在下文中一共展示了Navigation::setType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeList
/**
* Executes list action
*
* @param sfWebRequest $request A request object
*/
public function executeList(sfWebRequest $request)
{
$this->list = array();
$types = Doctrine::getTable('Navigation')->getTypesByAppName($request->getParameter('app', 'pc'));
foreach ($types as $type) {
$navs = Doctrine::getTable('Navigation')->retrieveByType($type);
foreach ($navs as $nav) {
$this->list[$type][] = new NavigationForm($nav);
}
$nav = new Navigation();
$nav->setType($type);
$this->list[$type][] = new NavigationForm($nav);
}
if ($request->isMethod('post')) {
$params = $request->getParameter('nav');
$type = $params['type'];
$count = count($this->list[$type]);
if ($params['id']) {
for ($i = 0; $i < $count - 1; $i++) {
if ($params['id'] === $this->list[$type][$i]->getObject()->id) {
$this->list[$type][$i]->bind($params);
break;
}
}
} else {
$this->list[$type][$count - 1]->bind($params);
}
}
}
示例2: up
public function up()
{
$navi = new Navigation();
$navi->Translation['en']->caption = 'Profile';
$navi->Translation['ja_JP']->caption = '[i:140]プロフィール';
$navi->setType('mobile_home_center');
$navi->setUri('member/profile');
$navi->setSortOrder(0);
$navi->save();
}
示例3: executeList
/**
* Executes list action
*
* @param sfWebRequest $request A request object
*/
public function executeList(sfWebRequest $request)
{
$this->list = array();
$types = Doctrine::getTable('Navigation')->getTypesByAppName($request->getParameter('app', 'pc'));
foreach ($types as $type) {
$navs = Doctrine::getTable('Navigation')->retrieveByType($type);
foreach ($navs as $nav) {
$this->list[$type][] = new NavigationForm($nav);
}
$nav = new Navigation();
$nav->setType($type);
$this->list[$type][] = new NavigationForm($nav);
}
}
示例4: up
public function up()
{
$navi = new Navigation();
$navi->Translation['en']->caption = 'Profile';
$navi->Translation['ja_JP']->caption = '[i:140]プロフィール';
$navi->setType('mobile_home_center');
$navi->setUri('member/profile');
$navi->setSortOrder(0);
$navi->save();
// and try to fix community topic revision if the plugin is exists
$conn = Doctrine_Manager::getInstance()->getConnectionForComponent('SnsConfig');
$result = $conn->fetchOne('SELECT value FROM sns_config WHERE name = ?', array('opCommunityTopicPlugin_revision'));
if (!$result) {
Doctrine::getTable('SnsConfig')->set('opCommunityTopicPlugin_revision', '4');
}
}
示例5: up
public function up()
{
$criteria = new Criteria();
$criteria->add(NavigationPeer::TYPE, 'mobile_home_side');
$criteria->add(NavigationPeer::URI, 'message/index');
if (!NavigationPeer::doSelectOne($criteria)) {
$navigation = new Navigation();
$navigation->setType('mobile_home_side');
$navigation->setUri('message/index');
$navigation->setSortOrder(20);
$navigation->setCulture('ja_JP');
$navigation->setCaption('メッセージ');
$navigation->setCulture('en');
$navigation->setCaption('Message');
$navigation->save();
}
}
示例6: up
public function up()
{
$navi = new Navigation();
$navi->Translation['en']->caption = 'Footprint';
$navi->Translation['ja_JP']->caption = 'あしあと';
$navi->setType('default');
$navi->setUri('ashiato/list');
$navi->setSortOrder(12);
$navi->save();
$navi = new Navigation();
$navi->Translation['en']->caption = 'Footprint';
$navi->Translation['ja_JP']->caption = '[i:91]あしあと';
$navi->setType('mobile_home');
$navi->setUri('ashiato/list');
$navi->setSortOrder(12);
$navi->save();
}
示例7: up
public function up()
{
$eventNavigation = new Navigation();
$eventNavigation->setType('community');
$eventNavigation->setUri('communityEvent/listCommunity');
$eventNavigation->setSortOrder(6);
$eventNavigation->setCaption('Events', 'en');
$eventNavigation->setCaption('イベントリスト', 'ja_JP');
$gadget = new Gadget();
$gadget->setType('contents');
$gadget->setName('recentCommunityEventComment');
$gadget->setSortOrder(132);
$gadget->save();
$gadget = new Gadget();
$gadget->setType('mobileContents');
$gadget->setName('recentCommunityEventComment');
$gadget->setSortOrder(111);
$gadget->save();
}