我的HTML5画布中有一个图像背景.
var canvas = new fabric.Canvas('#canvas1');
canvas.setBackgroundImage(
'http://fabricjs.com/assets/jail_cell_bars.png',
canvas.renderAll.bind(canvas)
);
Run Code Online (Sandbox Code Playgroud)
如何将画布的尺寸(宽度,高度)设置为背景图像的尺寸?
谢谢.
我创建了一个组件,在这个组件中我尝试重定向到不同的控制器/操作,但是我收到错误:" Error: Call to undefined method SessionRestComponent::redirect()
"
我的组件代码:
function iniciaSessao($username=''){
$_SESSION['username'] = $username;
// debug(isset($_SESSION['username']));
if (isset($_SESSION['username'])) {
$this->redirect(array('controller' => 'registos', 'action' => 'indexUser'));
}
}
Run Code Online (Sandbox Code Playgroud)
有人可以帮帮我吗?
我在CakePHP中开发了一个应用程序--Windows.
然后我把它放在Ubuntu中并进行必要的设置.一切都有效,除了线:
$this-> set (
'projeto_id',
$this-> requestAction (
"/Projects/getprojectsofcategory",
array (
'setor_id' => $this->Registration-> read()['Registration']['setor_id']
)
)
);
Run Code Online (Sandbox Code Playgroud)
给我以下错误:
致命错误错误:语法错误,意外'[',期待')'
而且我不明白为什么.如果我注释掉该行会出现以下错误,因为它属于同一类型.
有人能解释一下为什么会出现这个错