当前位置: 首页>>代码示例>>PHP>>正文


PHP Color::create方法代码示例

本文整理汇总了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.');
 }
开发者ID:aaronbullard,项目名称:litmus,代码行数:15,代码来源:ColorsController.php

示例2: __construct

 public function __construct()
 {
     $this->color = Color::create('000000');
     $this->type = GoogleChartLabelStyleNumberType::create();
     $this->size = 10;
     $this->dataPoint = -1;
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:7,代码来源:ChartLabelStyle.class.php

示例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());
     }
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:33,代码来源:GoogleChartTest.class.php

示例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
开发者ID:brandfeverinc,项目名称:coke-cooler,代码行数:31,代码来源:color_admin.php


注:本文中的Color::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。