日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

YYUC框架

發布時間:2024/8/1 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 YYUC框架 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

YYUC安裝

  • 假設本地項目目錄為 test, 將yyuc解壓并復制到test下。
  • 將 yyuc 下的forders復制到yyuc同級目錄下, 目錄結構如下,forders名稱可以自己修改。后續自己修改為 wx
  • - test - - forders - - yyuc 后期修改為 wx
  • 本地環境啟動目錄設置為 test/forders
  • nginx偽靜態設置為
  • try_files $uri $uri/ /index.php?$query_string; if (!-e $request_filename){ rewrite ^/(.*) /index.php last; }
  • php 版本為5.3,php7以上會報錯。例如mysql_collect等數據庫連接方法,php7以后都舍棄了。

  • hello world

    方式一

  • 在 wx/controller 下新建 /demo/hello.php
  • 內部代碼為
  • <?phpPage::ignore_view(); //忽略視圖Response::write("hello world"); //直接寫入 ?>
  • 訪問地址 http://x.com/demo/hello.php
  • 方式二

  • 在 wx/controller 下新建 /demo/hello.php, 內容為空
  • 在 wx/view/default 下新建 /demo/hello.html, 里面輸入html內容
  • 訪問地址 http://x.com/demo/hello.php
  • 方式三

  • 修改配置文件 wx/conf.php 將 $auto_find_view 改為 true
  • /**是否開啟無控制器時自動尋找對應視圖~默認:false*/ public static $auto_find_view = true;
  • 無需創建控制器文件直接建立文件,例在 wx/view/default 下新建 /demo/hello.html, 里面輸入html內容
  • 訪問地址 http://x.com/demo/hello.php

  • 配置數據庫

  • 在 wx/conf.php中配置
  • 配置如下
  • /**數據庫地址~*/public static $db_host = "localhost";/**數據庫端口~*/public static $db_port = "3306";/**數據庫名~*/public static $db_dbname = "test";/**數據庫用戶名~*/public static $db_username = "root";/**數據庫密碼~*/public static $db_password = "root";/**數據庫表前綴~為了區分同一個數據庫中不同框架的數據表,建議設置此項。*/public static $db_tablePrefix = "qq_";

    模板標簽

    表單項對應html備注
    all<textarea></textarea>模型所有非空屬性的表單集合(隱藏的)
    text<input typr=“text” />文本輸入
    password<input type=“password” />密碼框
    email<input type=“email”>郵件輸入框(html5)
    range<input type=“range”>程度選擇框(html5)
    hidden<input type=“hidden”>隱藏標簽
    textarea<textarea></textarea>文本框
    checkbox<input type=“checkbox”>多選按鈕
    select<select></select>下拉框
    radio<input type=“radio”>單選按鈕
    date<input type=“text”>時間選擇
    datetime<input type=“text”>時間日期選擇
    texteditor<textarea></textarea>富文本編輯器
    color<input type=“text”>顏色選擇框
    vercode<input type=“text”>驗證碼輸入框
    upload<input type=“file”>文件上傳

    舉例

  • php文件中
  • $note = new Model('notes');
  • html中應用
  • {$note->lable('title')} : {$note->title} <br> {$note->lable('author')} : {$note->author} <br> {$note->lable('theme')} : {$note->field_text('theme')} <br> {$note->lable('postdate')} : {$note->postdate} <br> {$note->lable('bepublished')} : {$note->field_text('bepublished')} <br> {$note->lable('content')} : {$note->content}

    視圖模板的引用

  • 創建規圖文件:view/default/notes/navigation.html
  • 在所有視圖文件中的 body標簽下方都引入此視圖
  • {T navigation}

    分頁

    總結

    以上是生活随笔為你收集整理的YYUC框架的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。