我只想了解其含义
<block type="page/html" name="root" output="toHtml" template="example/view.phtml">
Run Code Online (Sandbox Code Playgroud)
我从Google获得了许多参考资料,并了解了许多相关内容,但我仍然无法理解type="page/html"如何为我的自定义模块构建类型.
请解释
type="A/B"
Run Code Online (Sandbox Code Playgroud)
让我知道这个A和B来自哪里?
从2columns-right.phtml中的以下行开始
<div class="col-main">
<?php echo $this->getChildHtml('global_messages') ?>
<?php echo $this->getChildHtml('content') ?>
</div>
Run Code Online (Sandbox Code Playgroud)
我无法理解,从哪里来的内容<?php echo $this->getChildHtml('content') ?>.
调用witch .phtml文件来显示数据 <?php echo $this->getChildHtml('content') ?>
在angular 1中,我可以将任何元素定义为root元素,并且不能替换任何已编写的内联HTML。例如角度1。
<body>
<div ng-app="">
<h1><?php echo $heading_this_page;?></h1>
<p>Name : <input type="text" ng-model="name" placeholder="Enter name here"></p>
<h1>Hello {{name}}</h1>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
但是在角度2中,如果我这样写的话。
<body>
<ng-app>
<h1><?php echo $heading_this_page;?></h1>
<p>Name : <input type="text" ng-model="name" placeholder="Enter name here"></p>
<h1>Hello {{name}}</h1>
</ng-app>
</body>
Run Code Online (Sandbox Code Playgroud)
并且我用ng-app作主/根组件选择器,将ng-app元素的innerHTML 替换为组件的HTML。
@Component({
selector: 'ng-app',
template:'<h1>App works</h1>";
directives: [UsersComponent]
})
Run Code Online (Sandbox Code Playgroud)
即ng-app现在的innerHtml 变为<h1>App works</h1>。我希望ng-app保留以前的内容。
如果这不可能,我可以做下面的事情。
<body>
<ng-app>
<h1><?php echo $heading_this_page;?></h1>
<p>Name : <input type="text" ng-model="name" placeholder="Enter name here"></p>
<h1>Hello {{name}}</h1>
<render-component-here></render-component-here>
</ng-app>
</body> …Run Code Online (Sandbox Code Playgroud)