Laravel - Breadcrumbs模块:传递参数数组

时间:2016-08-20 10:35:44

标签: php laravel

我正在使用this module

我定义了Breadcrumbs,现在我尝试通过执行以下操作在我的刀片模板中进行渲染:

CREATE TABLE #temp124 (
    Col1 int,
    Col2 nvarchar=(max),
    ...etc
)

INSERT INTO #temp124
EXEC usp_GetTagDetails @UserId=1,@IsActiveOnly=1,@IsParentPathRequired=1

我的控制器{!! Breadcrumbs::render($breadcrumbs) !!} 被“控制”的值。

问题是我希望能够将一个参数数组传递给这个$breadcrumbs方法,而不仅仅是简单的字符串。确实,这里有一些我宣称的面包屑:

render()

在这种情况下,我需要能够将一个参数数组传递给Breadcrumbs::register('home', function($breadcrumbs) { $breadcrumbs->push('Home', route('home')); }); /* .... etc .... */ Breadcrumbs::register('style', function($breadcrumbs, $style_name, $style_slug) { $breadcrumbs->parent('styles'); $breadcrumbs->push($style_name, route('style', $style_slug)); }); 方法,该方法将由Controller发送到View。

我尝试了以下内容:

render()

但是我收到以下错误:

  

未定义的类常量'render'

1 个答案:

答案 0 :(得分:0)

此模块具有(function () { 'use strict'; angular .module("analytics") .directive("angularDirectiveAmcharts", angularDirectiveAmcharts); function angularDirectiveAmcharts() { var directive = { link: link, restrict: 'A', replace: true, scope: { chartdata: '=', type: '=', customstyle: '@', chartsettings: '=', chartid: '@' }, template: '<div id="{{ chartid }}" style="{{ customstyle }}"></div>' }; return directive; function link(scope, elem, attrs) { AmCharts.makeChart(scope.chartid, { "type": "serial", "categoryField": "date", "autoMarginOffset": 10, "marginRight": 20, "marginTop": 20, //I've deleted lots of keys and values for the sake of brevity "dataProvider": scope.chartdata }); } } })(); 方法。下次,我会阅读文档直到最后:)