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


PHP redirect::To方法代码示例

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


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

示例1: haberEkle

 public function haberEkle()
 {
     function trcharacter($s)
     {
         $tr = array('ş', 'Ş', 'ı', 'İ', 'ğ', 'Ğ', 'ü', 'Ü', 'ö', 'Ö', 'ç', 'Ç');
         $en = array('s', 's', 'i', 'i', 'g', 'g', 'u', 'u', 'o', 'o', 'c', 'c');
         $s = str_replace($tr, $en, $s);
         $s = strtolower($s);
         $s = preg_replace('/&.+?;/', '-', $s);
         $s = preg_replace('/[^%a-z0-9 _-]/', '-', $s);
         $s = preg_replace('/\\s+/', '-', $s);
         $s = preg_replace('|-+|', '-', $s);
         $s = str_replace("--", "-", $s);
         $s = trim($s, '-');
         return $s;
     }
     if (isset($_POST["ekle"])) {
         $data = Input::all();
         if (Input::hasFile('dosya')) {
             $file = Input::file('dosya');
             $destinationPath = 'haberResimler/';
             $extension = $file->getClientOriginalExtension();
             $filename = trcharacter(substr($file->getClientOriginalName(), 0, -5)) . "_" . str_random(12) . ".{$extension}";
             $upload_success = $file->move($destinationPath, $filename);
             DB::insert("insert into haberler values(null,?,?,?,?,now())", array($data["haber_baslik"], $data["detay"], $filename, $data["durum"]));
         }
     }
     return redirect::To('admin/haberler');
     //       $data = Input::all();
     //       $kural = array('haber_baslik'=>'required','detay'=>'required','dosya'=>'required','durum'=>'required' );
     //       $dogrulama = \Validator::Make($data,$kural);
     //       if($dogrulama->fails()) {
     //           // gönderilen verilerde hata var
     //           return \Redirect::to('admin/haberEkle')->withErrors($dogrulama)->withInput();
     //       }
     //       $dosya=Input::file('dosya');
     //       $uzanti = $dosya->getClientOriginalExtension();
     //       $dosyaAdi=date('YmdHis')."_b.".$uzanti;
     //       $path = base_path('haberResimler/'.$dosyaAdi);
     //       $imagePath = 'haberResimler/'.$dosyaAdi;
     //       //Image::make($dosya->getRealPath())->save($path);
     //       //Image::make($dosya->getRealPath())->save($path);
     //       Image::make($dosya->getRealPath())->resize(100, 100)->save($path);
     //       //var_dump($data);
     //       $veri = DB::insert("insert into haberler values(null,?,?,?,?,now())", array($data["haber_baslik"], $data["detay"],
     //           $imagePath,$data["durum"]));
     //       return \Redirect::to('admin/haberEkle');
 }
开发者ID:hakanozer,项目名称:laravelAdmin,代码行数:48,代码来源:haberEkleController.php

示例2: yeniSlider

 function yeniSlider()
 {
     function trcharacter($s)
     {
         $tr = array('ş', 'Ş', 'ı', 'İ', 'ğ', 'Ğ', 'ü', 'Ü', 'ö', 'Ö', 'ç', 'Ç');
         $en = array('s', 's', 'i', 'i', 'g', 'g', 'u', 'u', 'o', 'o', 'c', 'c');
         $s = str_replace($tr, $en, $s);
         $s = strtolower($s);
         $s = preg_replace('/&.+?;/', '-', $s);
         $s = preg_replace('/[^%a-z0-9 _-]/', '-', $s);
         $s = preg_replace('/\\s+/', '-', $s);
         $s = preg_replace('|-+|', '-', $s);
         $s = str_replace("--", "-", $s);
         $s = trim($s, '-');
         return $s;
     }
     if (isset($_POST["ekle"])) {
         $data = Input::all();
         if (Input::hasFile('dosya')) {
             $file = Input::file('dosya');
             $destinationPath = 'slider/';
             $extension = $file->getClientOriginalExtension();
             $filename = trcharacter(substr($file->getClientOriginalName(), 0, -5)) . "_" . str_random(12) . ".{$extension}";
             $upload_success = $file->move($destinationPath, $filename);
             DB::insert("insert into slider values (null,?,?,?,?,?,now())", array($data["adi"], $filename, $data["baslik"], $data["aciklama"], $data["url"]));
         }
     }
     return redirect::To('admin/sliderYonetimi');
 }
开发者ID:hakanozer,项目名称:laravelAdmin,代码行数:29,代码来源:sliderController.php


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