我从来没有尝试构建这样的表单,所以想看看是否有人以Symfony方式做这个解决方案。
所以示例代码在减去注释和getter设置器之下只是为了节省空间:)
//Entity
Class Location {
private $id;
private $name;
// one to many annotation is here
private $properties;
}
Class Property {
private $id;
private $name;
// many to one
private $location
}
//Controller code
class SomeController {
//anotation for route etc ;)
public function someAction(Request $request){
//Returns all locations and there properties (only 4 locations)
$locations = $this->getDoctrine()->getRepository('LocationEntity')->findAllWithProperties();
$form = $this->createForm(new needHelpHereType(), $locations);
}
}
那么我将如何创建一个执行followig的表单?
因此,为了让您了解屏幕显示,您会喜欢这样的事情。
位置名称1 位置1的属性集合
位置名称2 位置2的属性集合
位置名称3 位置3的属性集合
位置名称4 位置4的属性集合
感谢您的帮助:)
答案 0 :(得分:-1)
我认为library("dplyr")
library("ggvis")
library("lubridate")
data <- data.frame(timestamp = Sys.time() - hours(10:1),
signal = rnorm(10),
temperature = rnorm(10))
mySlider <- input_slider(0, 2, value = 1, step = 0.1, label = "T-correction")
data %>%
ggvis(~timestamp, ~signal) %>%
layer_paths() %>%
layer_paths(x = ~timestamp, y = ~temperature, stroke := "red") %>%
mutate(new_signal = signal - mySlider * temperature) %>% # here, I would like to add in the slider
layer_paths(x = ~timestamp, y = ~new_signal, stroke := "darkgreen")
是您的解决方案,
结帐链接here.
我希望这会有所帮助。