本文整理汇总了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();
}
}
示例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"]);
}
示例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);
}
示例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);
}
示例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]));
}
}
}
示例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);
}
示例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);
}
}
示例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();
}
示例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);
}
示例10: check_login
static function check_login()
{
return Params::is_set("code") && Params::get("code") == "frzadmin";
}
示例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;
}