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


PHP Params::is_set方法代码示例

本文整理汇总了PHP中Params::is_set方法的典型用法代码示例。如果您正苦于以下问题:PHP Params::is_set方法的具体用法?PHP Params::is_set怎么用?PHP Params::is_set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Params的用法示例。


在下文中一共展示了Params::is_set方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: aggiungi_immagine

 function aggiungi_immagine()
 {
     $id_prodotto_servizio = Params::get("id_prodotto_servizio");
     if (Params::is_set("file_field_name")) {
         $file_field_name = Params::get("file_field_name");
     } else {
         $file_field_name = "file";
     }
     if (Upload::isUploadSuccessful($file_field_name)) {
         $product_dir = new Dir(self::PRODUCT_IMAGE_DIR . "/" . $id_prodotto_servizio);
         $product_dir->touch();
         $uploaded_img = Upload::saveTo($file_field_name, $product_dir);
         if (isset(Config::instance()->PRODUCT_IMAGE_RESIZE_BY_WIDTH)) {
             image_w($uploaded_img->getPath(), Config::instance()->PRODUCT_IMAGE_RESIZE_BY_WIDTH);
         } else {
             if (isset(Config::instance()->PRODUCT_IMAGE_RESIZE_BY_HEIGHT)) {
                 image_h($uploaded_img->getPath(), Config::instance()->PRODUCT_IMAGE_RESIZE_BY_HEIGHT);
             }
         }
         //creo una riga associata all'immagine
         $immagine_prodotto_servizio_peer = new ImmagineProdottoServizioPeer();
         $do = $immagine_prodotto_servizio_peer->new_do();
         $do->id_prodotto_servizio = Params::get("id_prodotto_servizio");
         $do->nome_immagine = $uploaded_img->getFilename();
         $immagine_prodotto_servizio_peer->save($do);
         return Redirect::success();
     } else {
         Flash::error(Upload::getUploadError($file_field_name));
         return Redirect::failure();
     }
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:31,代码来源:ProdottoServizioController.class.php

示例2: testParamsNotset

 function testParamsNotset()
 {
     $_POST["__not_set_hello"] = 5;
     Params::clear();
     Params::importFromPost();
     $this->assertTrue(Params::is_set("hello"), "Il parametro hello non e' stato caricato!!");
     $this->assertEqual(Params::get("hello"), "5", "Il parametro hello non e' stato caricato!!");
     unset($_POST["__not_set_hello"]);
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:9,代码来源:params_test.php

示例3: get_vetrina

 public function get_vetrina()
 {
     $peer = new VetrinaPeer();
     if (Params::is_set("id_vetrina")) {
         $do = $peer->find_by_id(Params::get("id_vetrina"));
     } else {
         $peer->nome_vetrina__EQUAL(Params::get("nome_vetrina"));
         $do_list = $peer->find();
         $do = $do_list[0];
     }
     return ActiveRecordUtils::toArray($do);
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:12,代码来源:VetrineController.class.php

示例4: get

 function get()
 {
     $peer = new TestiPeer();
     if (Params::is_set("id")) {
         $do = $peer->find_by_id(Params::get("id"));
     } else {
         ActiveRecordUtils::updateFilters($peer);
         $results = $peer->find();
         if (count($results) > 0) {
             $do = $results[0];
         } else {
             $do = null;
         }
     }
     return ActiveRecordUtils::toArray($do);
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:16,代码来源:TestiController.class.php

示例5: get

 function get()
 {
     $peer = new FolderPeer();
     if (Params::is_set("id")) {
         $result = ActiveRecordUtils::toArray($peer->find_by_id(Params::get("id")));
         return self::load_attributes($result);
     } else {
         ActiveRecordUtils::updateFilters($peer);
         $results = $peer->find();
         if (count($results) == 0) {
             return null;
         } else {
             return self::load_attributes(ActiveRecordUtils::toArray($results[0]));
         }
     }
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:16,代码来源:FoldersController.class.php

示例6: get

 function get()
 {
     $peer = $this->__myPeer();
     if ($this->__dump_enabled()) {
         $peer->__dump_sql();
     }
     $pk_fields = $peer->__getPrimaryKeyFields();
     if (Params::is_set($pk_fields[0])) {
         $do = $peer->find_by_id(Params::get($pk_fields[0]));
     } else {
         ActiveRecordUtils::updateFilters($peer);
         $results = $peer->find();
         if (count($results) > 0) {
             $do = $results[0];
         } else {
             $do = null;
         }
     }
     return ActiveRecordUtils::toArray($do);
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:20,代码来源:AbstractEntityController.class.php

示例7: updatePageFilters

 public static function updatePageFilters($peer)
 {
     if (Params::is_set(self::PAGE_SIZE_KEY) && Params::get(self::PAGE_SIZE_KEY) != "" && Params::is_set(self::PAGE_NUM_KEY) && Params::get(self::PAGE_NUM_KEY) != "") {
         $page_size = Params::get(self::PAGE_SIZE_KEY);
         $page_num = Params::get(self::PAGE_NUM_KEY);
         $peer->__PAGE($page_num, $page_size);
     }
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:8,代码来源:ActiveRecordUtils.class.php

示例8: accept

 function accept()
 {
     $accepted = Params::get("accept");
     $nome_parametro = Params::is_set("nome_parametro") ? Params::get("nome_parametro") : "[IMPOSTA IL NOME DELLA CHECKBOX OBBLIGATORIA]";
     if ($accepted !== "accept") {
         return Result::error("È necessario accettare " . $nome_parametro . ".");
     }
     return Result::ok();
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:9,代码来源:ValidationController.class.php

示例9: setupByParams

 public function setupByParams($do)
 {
     $fields = $this->__getAllFields();
     $pk_fields = $this->__getPrimaryKeyFields();
     $params_list = array();
     //tolgo le chiavi primarie
     foreach (ArrayUtils::delete_keys($fields, $pk_fields) as $fkey => $attribs) {
         if (Params::is_set($fkey)) {
             $params_list[$fkey] = Params::get($fkey);
         }
     }
     foreach (Params::keys() as $k) {
         if (StringUtils::starts_with($k, self::CHECK_PREFIX)) {
             $field_to_check = substr($k, strlen(self::CHECK_PREFIX));
             if (Params::is_set($field_to_check)) {
                 $params_list[$field_to_check] = true;
             } else {
                 $params_list[$field_to_check] = false;
             }
         }
     }
     return $this->setupWithMap($do, $params_list);
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:23,代码来源:AbstractPeer.class.php

示例10: check_login

 static function check_login()
 {
     return Params::is_set("code") && Params::get("code") == "frzadmin";
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:4,代码来源:SuperAdminUtils.class.php

示例11: get_gallery

 function get_gallery()
 {
     if (Params::is_set("id_gallery")) {
         $id_gallery = Params::get("id_gallery");
         $peer = new GalleryPeer();
         $gallery = $peer->find_by_id($id_gallery);
     } else {
         $gallery_name = Params::get("gallery_name");
         $tokens = preg_split("/\\//", $gallery_name);
         $collection_key = $tokens[0];
         $gallery_key = $tokens[1];
         $collection = call("gallery_collection", "get_collection_by_key", array("key" => $collection_key));
         $peer = new GalleryPeer();
         $peer->id_gallery_collection__EQUAL($collection["id_gallery_collection"]);
         $peer->key__EQUAL($gallery_key);
         $gallery = $peer->find_single_result();
     }
     $collection_peer = new GalleryCollectionPeer();
     $gallery_collection = $collection_peer->find_by_id($gallery->id_gallery_collection);
     $folder_path = GalleryCollectionController::GALLERY_COLLECTION_ROOT_DIR . $gallery_collection->folder . "/" . $gallery->folder;
     $gallery_data = ActiveRecordUtils::toArray($gallery);
     $image_list = call("gallery_image", "index", array("__filter_id_gallery__EQUAL" => $gallery_data["id_gallery"]));
     foreach ($image_list as $k => &$img) {
         $img["path"] = $folder_path . "/" . $img["image_name"];
     }
     $gallery_data["image_list"] = $image_list;
     $gallery_data["gallery_name"] = $gallery_collection->key . "/" . $gallery->key;
     $gallery_data["id_collection"] = $gallery->id_gallery_collection;
     return $gallery_data;
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:30,代码来源:GalleryController.class.php


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