本文整理汇总了PHP中Color::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Color::create方法的具体用法?PHP Color::create怎么用?PHP Color::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Color
的用法示例。
在下文中一共展示了Color::create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store(Palette $palette)
{
$input = Input::all();
$validation = Validator::make($input, Color::$rules);
if ($validation->passes()) {
$this->color->create($input);
return Redirect::route($this->route . '.index', $palette->id);
}
return Redirect::back()->withInput()->withErrors($validation)->with('message', 'There were validation errors.');
}
示例2: __construct
public function __construct()
{
$this->color = Color::create('000000');
$this->type = GoogleChartLabelStyleNumberType::create();
$this->size = 10;
$this->dataPoint = -1;
}
示例3: testTwoAxis
/**
* @dataProvider twoAxisDataProvider
**/
public function testTwoAxis($firstAxisData, $secondtAxisData, $result)
{
foreach ($result as $chartClass => $expectedString) {
$views = GoogleChartDataSet::create()->setData($firstAxisData);
$clicks = GoogleChartDataSet::create()->setData($secondtAxisData);
$chart = new $chartClass();
if ($chart->getData()->isNormalized()) {
if ($views->getMax() >= 10) {
$base = pow(10, floor(log10($views->getMax())));
} else {
$base = 0.1;
}
$views->setBase($base);
if ($clicks->getMax() >= 10) {
$base = pow(10, floor(log10($clicks->getMax())));
} else {
$base = 0.1;
}
$clicks->setBase($base);
}
$viewAxis = GoogleChartAxis::create(new GoogleChartAxisType(GoogleChartAxisType::Y))->setRange($views->getMinMax());
$clickAxis = GoogleChartAxis::create(new GoogleChartAxisType(GoogleChartAxisType::R))->setRange($clicks->getMinMax());
if ($chart->getData()->isNormalized()) {
$viewAxis->setInterval($views->getBase());
$clickAxis->setInterval($clicks->getBase());
}
$chart->setSize(GoogleChartSize::create()->setWidth(300)->setHeight(300))->addAxis($viewAxis)->addLine(GoogleChartLine::create()->setTitle('Показы')->setColor(Color::create('336699'))->setValue($views))->addAxis($clickAxis)->addLine(GoogleChartLine::create()->setTitle('Клики')->setColor(Color::create('339911'))->setValue($clicks));
$this->assertEquals($expectedString, $chart->toString());
}
}
示例4: header
} else {
$id = $_REQUEST["id"];
$_REQUEST['mode'] = 'e';
}
// if form was submitted:
if ($_POST['commit'] == "Cancel") {
header("Location:color_list.php?cat=" . $_REQUEST['cat']);
exit;
}
if ($_POST['commit'] == "Save Color") {
if ($id == 0) {
// insert
$obj = new Color();
$obj->CategoryId = $_REQUEST["cat"];
$obj->OverviewText = $_REQUEST["overview_text"];
$obj->create();
// redirect to listing list
header("Location:color_list.php&cat=" . $_REQUEST['cat']);
exit;
} else {
// update
$obj = new Color($_REQUEST["id"]);
$obj->OverviewText = $_REQUEST["overview_text"];
$obj->update();
// redirect to listing list
header("Location:color_list.php&cat=" . $_REQUEST['cat']);
exit;
}
} else {
if ($_REQUEST['mode'] == 'e') {
//listing