Example #1
0
 public static function create_data($url, $count, $p = 0, $m = 10)
 {
     $i = isset($_GET['i']) ? '?i=' . $_GET['i'] : '';
     $f = isset($_GET['f']) ? '&f=' . $_GET['f'] : '';
     $s = isset($_GET['s']) ? '&s=' . $_GET['s'] : '';
     $data = array('url' => $url, 'count' => ceil($count / $m), 'p' => $p, 's' => $s, 'i' => $i, 'f' => $f);
     return Import::view($data, '_snippet', 'pagination_data');
 }
Example #2
0
 public function main($params = '')
 {
     //----------------------------------------------------------------------------------------------------
     // Gönderilen veriler: font, style, title
     //----------------------------------------------------------------------------------------------------
     $data['font'] = Import::font('font', true);
     $data['style'] = Import::style('style', true);
     $data['title'] = 'ZERONEED PHP WEB FRAMEWORK';
     //----------------------------------------------------------------------------------------------------
     // Dahil edilen sayfa: Application/Views/welcome.php
     //----------------------------------------------------------------------------------------------------
     Import::view('welcome', $data);
 }
Example #3
0
 public function form($id = "")
 {
     if (empty($id)) {
         $head['title'] = 'Yönetici Ekle';
         $head['meta']['author'] = 'Bursa yazılım';
         $headData["kullaniciAdi"] = User::data()->username;
         $bodyVeri["data"] = ['action' => siteUrl('yonetim/ekle')];
         $bodyVeri["data"] = ['action' => siteUrl('yonetim/ekle'), 'yoneticiDetay' => ["username" => "", "pass" => "", "email" => "", "isim" => "", "soyisim" => "", "durum" => "", "ban_durum" => ""]];
     } else {
         $head['title'] = 'Yönetici Düzenle';
         $head['meta']['author'] = 'Bursa yazılım';
         $headData["kullaniciAdi"] = User::data()->username;
         $yoneticiDetay = $this->yonetici->detay($id);
         $bodyVeri["data"] = ['action' => siteUrl('yonetim/duzenle/' . $id), 'yoneticiDetay' => $yoneticiDetay];
     }
     $data['head'] = Import::view('head', $headData, true);
     $data['footer'] = Import::view('footer', '', true);
     $data['body'] = Import::view('yonetimForm', $bodyVeri, true);
     Import::masterPage($data, $head);
 }
Example #4
0
 public function index($params = "")
 {
     /******************************************************************************************
     		* Gönderilen Veriler                                                                      *
     		*******************************************************************************************
     		| 1. title => ZN FRAMEWORK                                                                |
     		| 2. style => Views/Styles/style.css                                                      |
     		| 3. font => Views/Fonts/textfont.ttf                                                     |
     		| 4. welcomeMessage => ZN KOD ÇATISINA HOŞ GELDİNİZ                                       |
     		******************************************************************************************/
     $data["title"] = "ZN FRAMEWORK";
     $data["style"] = Import::style("style", true);
     $data["font"] = Import::font("textfont", true);
     $data["welcomeMessage"] = "PHP Web Framework <b>Made In Turkey</b>";
     /******************************************************************************************
     		* Dahil Edilen Welcome.php Görünüm Sayfası                                                *
     		*******************************************************************************************
     		| 1. welcome => Views/Pages/welcome.php sayfası dahil ediliyor.					          |
     		| 2. data => Yukarıdaki verileri tutan data dizisi dahil edilen sayfaya gönderiliyor.	  |
     		| 3. false => Sayfa doğrudan görüntüleniyor.				          			  		  |
     		| NOT: Bu işlem için view() ya da page() yöntemlerinden her ikiside kullanılabilir.		  |
     		******************************************************************************************/
     Import::view("welcome", $data);
 }
Example #5
0
 public function form($id = "")
 {
     /*
      * Haber Form hem ekleme hemde güncellemede kullanılması için $id parametresi koyulmuştur.
      * Her yapılacak ekleme ve düzenleme işlemi için ayrı ayrı View dosyası oluşturup
      * dosya kalabalığı oluşturmak yerine bu şekilde kullanmayı tercih ediyorum
      * Eğer id boş ise haber ekleme yapar $id değeri dolu ise düzenleme yapmak için
      * $id değerine sahip ilgili haberin verisini çeker.
      * */
     if (empty($id)) {
         $head['title'] = 'Haber Ekle';
         $head['meta']['author'] = 'Bursa yazılım';
         $headData["kullaniciAdi"] = User::data()->username;
         /*
          * haberForm view sayfası hem ekleme hem düzenlemede kullanıldığı için
          * View'da ki formun action adresini de değişkenle gönderiyoruz.
          * Bu if koşulu içinde $id boş olduğu için formumuz haber ekleme formu olarak çalışacak
          * else koşulu içinde ise düzenleme yapılacağından action verileri haber/duzenle 'ye gönderecek
          * */
         $bodyVeri["data"] = ['action' => siteUrl('haber/ekle')];
         /*
          * 'haberDetay'=>["baslik"=>"","detay"=>"","etiketler"=>"","durum"=>""
          * dizilimi, haber ekleme formunda hata vermemesi için değişkenlere boş veri gönderir.
          *
          * */
         $bodyVeri["data"] = ['action' => siteUrl('haber/ekle'), 'haberDetay' => ["baslik" => "", "detay" => "", "etiketler" => "", "durum" => ""]];
     } else {
         $head['title'] = 'Haber Ekle';
         $head['meta']['author'] = 'Bursa yazılım';
         $headData["kullaniciAdi"] = User::data()->username;
         $haberDetay = $this->haberler->detay($id);
         $bodyVeri["data"] = ['action' => siteUrl('haber/duzenle/' . $id), 'haberDetay' => $haberDetay];
     }
     $data['head'] = Import::view('head', $headData, true);
     $data['footer'] = Import::view('footer', '', true);
     $data['body'] = Import::view('haberForm', $bodyVeri, true);
     Import::masterPage($data, $head);
 }
Example #6
0
 public function index($params = '')
 {
     $head['title'] = 'YÖNETİM PANELİ';
     $head['meta']['author'] = '';
     $headData["kullaniciAdi"] = Session::select('kisi');
     $bodyVeri["uyari"] = redirectData('uyari');
     $data['head'] = Import::view('head', $headData, true);
     $data['footer'] = Import::view('footer', '', true);
     $data['body'] = Import::view('anasayfa', $bodyVeri, true);
     Import::masterPage($data, $head);
 }
Example #7
0
 /**
  * Renderiza uma página no lugar da view
  * @param	object	$ob		objeto com informações da página e da master page
  * @return	void
  */
 private function renderPartial($ob)
 {
     $this->response .= Import::view($ob->Vars, $ob->Data['controller'], $ob->Data['view']);
 }
Example #8
0
 /**
  * Use the view file.
  *
  * @param string $name
  * @access public
  */
 function template($name)
 {
     $view = Import::view();
     $view->Controller =& $this;
     //$this=>view对象
     if (isset($view->Controller->Session)) {
         $view->Session =& $view->Controller->Session;
     }
     if (isset($view->Controller->Cache)) {
         $view->Cache =& $view->Controller->Cache;
     }
     $class_M = ucwords($this->__module);
     $view->{$class_M} =& $view->Controller->{$class_M};
     //将模块名称传给视图模块
     $view->App =& $view->Controller->{$class_M};
     $view->load($name);
 }
Example #9
0
 public function render_partial($partial_name, $options = array())
 {
     $start = microseconds();
     $params = $this->view_params();
     if (array_key_exists("locals", $options)) {
         if (is_array($options["locals"])) {
             $params = array_merge($params, $options["locals"]);
         }
     }
     # When partial_name has a slash assume they
     # know what template they are looking for.
     # Otherwise look for the partial name in the default location.
     if (strpos($partial_name, "/") > 0) {
         $segments = explode("/", $partial_name);
         $segments[count($segments) - 1] = "_" . end($segments);
         $partial = join("/", $segments);
     } else {
         $partial = $params["params"]["controller"] . "/" . "_{$partial_name}";
     }
     ob_start();
     Import::view($partial, $this->file_extension(), $params);
     $output = ob_get_contents();
     ob_end_clean();
     Logger::render("Rendering {$partial} (" . (microseconds() - $start) . " ms)\n");
     return $output;
 }