我正在研究一个包,我真的需要能够解雇
php artisan asset:publish --bench="vendor/package"
Run Code Online (Sandbox Code Playgroud)
在开发期间自动命令.
每次我更改我的包中的JavaScript或CSS文件时,编写该命令都非常耗时.
我试图在服务提供商处打电话给Artisan
public function boot()
{
Artisan::call('asset:publish', array('--bench' => 'arni-gudjonsson/webber'));
...
}
Run Code Online (Sandbox Code Playgroud)
我有
ErrorException: Runtime Notice: Non-static method Illuminate\Foundation\Artisan::call() should not be called statically, assuming $this from incompatible context
Run Code Online (Sandbox Code Playgroud)
Artisan不是通过网络设计的吗?有人有什么建议吗?
在Larvel 4中,我正在尝试设置嵌套资源控制器.
在routes.php中:
Route::resource('admin/photo', 'Controllers\\Admin\\PhotoController');
Run Code Online (Sandbox Code Playgroud)
在app\controllers\Admin\PhotoController.php中:
<?php namespace Controllers\Admin;
use Illuminate\Routing\Controllers\Controller;
class PhotoController extends Controller {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return 'index';
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
// …Run Code Online (Sandbox Code Playgroud) 我正在尝试将对象添加到我的Emberjs Arraycontroller中.我有一个"创建"动作,按下按钮时会触发.这工作正常但我似乎无法将具有this.pushObject函数的元素添加到ArrayController.我收到此错误消息:
Uncaught Error: The result of a server query (on App.Software) is immutable.
Run Code Online (Sandbox Code Playgroud)
我想这是因为我使用RESTAdapter来加载数据而且我不喜欢我手动添加元素?
这是我的控制器和创建动作.
App.SoftwareIndexController = Ember.ArrayController.extend({
sortProperties: ['revision'],
create:function(){
var revision = $('#software_revision').val();
var doc = $('#software_document').val();
var software = App.Software.createRecord({
product_id: 1,
revision: revision,
doc: doc
});
this.pushObject(software);
}
});
Run Code Online (Sandbox Code Playgroud)
这是路线
App.SoftwareIndexRoute = Ember.Route.extend({
setupController:function(controller){
var product_id = 1;
controller.set('content', App.Software.find({product_id:1}));
}
});
Run Code Online (Sandbox Code Playgroud)
这是模型和商店
App.Store = DS.Store.extend({
revision: 12,
adapter: 'DS.RESTAdapter'
});
DS.RESTAdapter.configure("plurals", {
software: "software"
});
App.Software = DS.Model.extend({
revision: DS.attr('string'),
doc: DS.attr('string'),
verified: DS.attr('boolean') …Run Code Online (Sandbox Code Playgroud) Ember.JS和CKEDITOR之间存在冲突.如果我使用Ember.js,工具栏(模态窗口)不起作用.如果我尝试按下例如粘贴按钮,那么我得到以下错误消息,窗口没有模态窗口.
Uncaught TypeError: Cannot read property 'type' of undefined
Run Code Online (Sandbox Code Playgroud)

如果我删除Ember.Js,那么CKeditor工作正常.
在jsfiddle上查看问题的现场演示 http://jsfiddle.net/HEhMq/13/
这就是我将CKEDITOR嵌入到我的ember模板中的方法:
App.HTMLTextArea = Ember.TextArea.extend({
didInsertElement: function() {
this._super();
var self = this;
var elementId = self.get('elementId');
var edit = CKEDITOR.replace( elementId, {
extraPlugins : 'autogrow',
autoGrow_maxHeight : 800,
// Remove the Resize plugin as it does not make sense to use it in conjunction with the AutoGrow plugin.
removePlugins : 'resize'
});
edit.on('blur', function(e) {
if (e.editor.checkDirty()) {
self.set('value', edit.getData() );
}
});
}
});
Run Code Online (Sandbox Code Playgroud)
使用此代码,编辑器可以正常加载,并更新Ember值.只是工具栏按钮不起作用.
有人有同样的问题吗?