我想问你这个问题.使用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) 当我添加
<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)
构造函数正在破碎.
但我需要在所有元素中使用不同的名称.