小编str*_*sly的帖子

带Zend\Navigation\Navigation的ZF2动态菜单

我想问你这个问题.使用Zend\Navigation\Navigation创建动态菜单需要什么?

在ZF1中,我做了这样的:

$container = new Zend_Navigation();
$pages = array(
array(
    'label'  => 'Save',
    'action' => 'save',
),
array(
    'label'  => 'Delete',
    'action' => 'delete',
),
);
// add two pages
$container->addPages($pages);
Run Code Online (Sandbox Code Playgroud)

然后在视图中:

$this->navigation()->menu();
Run Code Online (Sandbox Code Playgroud)

但在ZF2中,页面正在从配置中获取.现在我创建\ config\autoload \nav.global.php并在这里创建页面数组.但我需要在方法中做页面数组并将其发送到导航助手,但我不知道如何((

我试图在我的控制器中执行此操作:

use Zend\Navigation\Navigation;
$pages =array(
        // All navigation-related configuration is collected in the 'navigation' key
        'navigation' => array(
            // The DefaultNavigationFactory we configured in (1) uses 'default' as the sitemap key
            'default' => array(
                // And finally, here is where we define our page …
Run Code Online (Sandbox Code Playgroud)

php navigation menu dynamic zend-framework2

5
推荐指数
1
解决办法
1万
查看次数

绑定控件的x:名称

当我添加

    <TextBlock  Text="{Binding SettingName}" TextWrapping="Wrap" Margin="10,-2,10,0" Style="{StaticResource PhoneTextSubtleStyle}" />    
Run Code Online (Sandbox Code Playgroud)

Everuthing还可以.但当

 <TextBlock x:Name="{Binding SettingTextBlockName}"  Text="{Binding SettingName}" TextWrapping="Wrap" Margin="10,-2,10,0" Style="{StaticResource PhoneTextSubtleStyle}" />
Run Code Online (Sandbox Code Playgroud)

构造函数正在破碎.

但我需要在所有元素中使用不同的名称.

c# wpf xaml binding

2
推荐指数
2
解决办法
5980
查看次数

标签 统计

binding ×1

c# ×1

dynamic ×1

menu ×1

navigation ×1

php ×1

wpf ×1

xaml ×1

zend-framework2 ×1