我想显示订单详细信息表单数据库。我使用序列化方法将购物车数据存储到数据库中。当我想显示数据时,我无法正确显示它。只能打印订单对象。并给出一个错误。那是
(1/1)FatalErrorException语法错误,意外的“ endforeach” (T_ENDFOREACH)在9ad30ab1db6ca668d8a75c428e65858dc800d045.php第27行
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1>User Profile</h1>
<hr>
<h2>My Oders</h2>
@foreach($orders as $order)
<div class="panel panel-default">
<div class="panel-body">
<ul class="list-group">
@forecah($order->cart->items as $product)
<li class="list-group-item">
<span class="badge">{{$product['product_price']}}
</span>
{{$product['item']['product_name']}} |
{{$product['qty']}} Units
</li>
@endforeach
</ul>
</div>
<div class="panel-footer">
<strong>Total Price : {{$order->cart->totalPrice}}</strong>
</div>
</div>
@endforeach
</div>
</div>
答案 0 :(得分:0)
您的代码中有错字:
@forecah($order->cart->items as $product)
尝试更改为:
@foreach($order->cart->items as $product)e
希望它能工作..因为它之前没有检测到foreach循环。
答案 1 :(得分:0)
您对private void StartAppWatcher(string elementName, FindWindowMethod method)
{
windowElement = GetAppElement(elementName, method);
// (...)
// You may want to to something if the watched application is already running when you start your app
Automation.AddAutomationEventHandler(WindowPattern.WindowOpenedEvent, AutomationElement.RootElement,
TreeScope.Subtree, (elm, e) => {
AutomationElement element = elm as AutomationElement;
try
{
if (element == null || element.Current.ProcessId == currentProcessId) return;
if (windowElement == null) windowElement = GetAppElement(elementName, method);
//if (windowElement == null || windowElement.ProcessId != element.Current.ProcessId) return;
// If the Window is a MessageBox generated by the watched app, attach the handler
if (element.Current.Name == "Dialog")
{
buttonElement = element;
var msgBoxButton = element.FindFirst(TreeScope.Descendants,
new PropertyCondition(AutomationElement.NameProperty, "OK"));
if (msgBoxButton != null && msgBoxButton.GetSupportedPatterns().Any(p => p.Equals(InvokePattern.Pattern)))
{
Automation.AddAutomationEventHandler(
InvokePattern.InvokedEvent, msgBoxButton, TreeScope.Element,
DialogButtonHandler = new AutomationEventHandler(MessageBoxButtonHandler));
}
}
}
catch (ElementNotAvailableException)
{
// Ignore: this exception may be raised if you show a modal dialog,
// in your own app, that blocks the execution. When the dialog is closed,
// AutomationElement element is no longer available
}
});
Automation.AddAutomationEventHandler(WindowPattern.WindowClosedEvent, AutomationElement.RootElement,
TreeScope.Subtree, (elm, e) => {
AutomationElement element = elm as AutomationElement;
if (element == null || element.Current.ProcessId == currentProcessId || windowElement == null) return;
if (windowElement.ProcessId == element.Current.ProcessId)
{
if (windowElement.MainWindowTitle == element.Current.Name)
{
windowElement = null;
}
}
});
}
private void MessageBoxButtonHandler(object sender, AutomationEventArgs e)
{
MessageBox.Show("Dialog Box clicket at : " + DateTime.Now);
Automation.RemoveAutomationEventHandler(e.EventId, buttonElement, DialogButtonHandler);
}
的拼写有误。您应该纠正拼写。
查看第二个forecah
并更改拼写。
您可以在下面复制代码,因为我更改了拼写。
foreach