• 授权方式:开源软件
  • 界面语言:其它类型
  • 文件大小:0.8MB
  • 更新时间:2013-07-28
  • 资源类型:国产软件
  • 推荐等级:★★★☆☆
  • 平台环境:php
  • 作者主页:点击查看
  • 演示地址:点击查看

详细介绍 – [ DoYouHaoBaby(PHP开发框架)v2.5.2 Release20130727 ]

BUTIFUL APP START HERE | PHP-5.0-PHP-5.4以及更高版本支持

DoYouHaoBaby-2.5.2(20130727)

简介

DoYouHaoBaby ( 全名:The DoYouHaoBaby PHP Framework )是一个极具美学价值的PHP开发框架,从代码、注释、文 档以及系统工具的用户界面均追求干净、整洁而高效。DoYouHaoBaby核心思想来自于QeePHP,使用习惯靠近ThinkPHP。

关于代码更新

最新代码大家可以从 https://github.com/dyhb/windsforce/tree/master/upload/source/include 找到最新的代码,相关更新也在那里。

主要修正COOKIE设计的不合理之处,以及修复几个核心BUG,添加一些小新功能。

示例代码(来自于WindsForce-1.0.1)

选自 {windsforce}/upload/source/model/UserModel.class.php


  1. <?php 
  2. /* [$WindsForce] (C)WindsForce TEAM Since 2012.03.17. 
  3.    用户模型($Liu.XiangMin)*/ 
  4.  
  5. !defined(\'DYHB_PATH\') && exit
  6.  
  7. class UserModel extends CommonModel{ 
  8.  
  9.     static public function init__(){ 
  10.  
  11.         return array
  12.             \'behaviors\'=>\'rbac\'
  13.             /* -- more -- */ 
  14.         ); 
  15.     } 
  16.  
  17.     static function F(){ 
  18.         $arrArgs=func_get_args(); 
  19.         return ModelMeta::instance(__CLASS__)->findByArgs($arrArgs); 
  20.     } 
  21.  
  22.     static function M(){ 
  23.         return ModelMeta::instance(__CLASS__); 
  24.     } 
  25.  
  26.     /* -- more -- */ 
  27.  

 选自 {windsforce}/upload/app/group/App/Class/Extension/Groupdata_Extend.class.php

 


  1. static public function getGroup($oGroupcategeory){ 
  2.     if(!$oGroupcategeory[\'groupcategory_groupmaxnum\']){ 
  3.         $nNum=$GLOBALS[\'_cache_\'][\'group_option\'][\'group_indexgroupmaxnum\']; 
  4.          
  5.         if($nNum<1){ 
  6.             $nNum=1; 
  7.         } 
  8.     }else
  9.         $nNum=$oGroupcategeory[\'groupcategory_groupmaxnum\']; 
  10.     } 
  11.  
  12.     // 查询条件 
  13.     $arrWhere=array(); 
  14.     $arrWhere[\'group_status\']=1; 
  15.     $arrWhere[\'group_isaudit\']=1; 
  16.  
  17.     $arrGroupcategoryindexs=GroupcategoryindexModel::F(\'groupcategory_id=?\',$oGroupcategeory[\'groupcategory_id\'])->getAll(); 
  18.     if(is_array($arrGroupcategoryindexs)){ 
  19.         $arrTempdata=array(); 
  20.         foreach($arrGroupcategoryindexs as $oGroupcategoryindex){ 
  21.             $arrTempdata[]=$oGroupcategoryindex[\'group_id\']; 
  22.         } 
  23.          
  24.         $arrWhere[\'group_id\']=array(\'in\',$arrTempdata); 
  25.     }else
  26.         $arrGroups=\'\'
  27.     } 
  28.  
  29.     // 排序 
  30.     switch($oGroupcategeory[\'groupcategory_groupsorttype\']){ 
  31.         case 1: 
  32.             $sOrdertype=\'update_dateline DESC\'
  33.             break
  34.         case 2: 
  35.             $sOrdertype=\'group_totaltodaynum DESC\'
  36.             break
  37.         case 3: 
  38.             $sOrdertype=\'group_usernum DESC\'
  39.             break
  40.         case 0: 
  41.         default
  42.             $sOrdertype=\'group_isrecommend DESC,create_dateline DESC\'
  43.             break
  44.     } 
  45.  
  46.     if(!isset($arrGroups)){ 
  47.         $arrGroups=GroupModel::F()->where($arrWhere)->order($sOrdertype)->limit(0,$nNum)->getAll(); 
  48.     } 
  49.  
  50.     return $arrGroups

控制器C:

选自 {windsforlce}/upload/app/home/App/Class/Controlle/Public/Logincontroller.class.php


  1. <?php 
  2. /* [$WindsForce] (C)WindsForce TEAM Since 2012.03.17. 
  3.    前台登陆($Liu.XiangMin)*/ 
  4.  
  5. !defined(\'DYHB_PATH\') && exit
  6.  
  7. // 导入社会化登录组件 
  8. Dyhb::import(WINDSFORCE_PATH.\'/source/extension/socialization\'); 
  9.  
  10. class LoginController extends GlobalchildController{ 
  11.  
  12.     public function index(){ 
  13.         $nInajax=intval(G::getGpc(\'inajax\',\'G\')); 
  14.         $sReferer=trim(G::getGpc(\'referer\')); 
  15.         $nRbac=intval(G::getGpc(\'rbac\',\'G\')); 
  16.         $nLoginview=intval(G::getGpc(\'loginview\',\'G\')); 
  17.          
  18.         if($GLOBALS[\'___login___\']!==false){ 
  19.             $this->assign(\'__JumpUrl__\',__APP__); 
  20.             $this->E(Dyhb::L(\'你已经登录\',\'Controller/Public\')); 
  21.         } 
  22.  
  23.         Core_Extend::loadCache(\'sociatype\'); 
  24.  
  25.         $this->assign(\'nDisplaySeccode\',$GLOBALS[\'_option_\'][\'seccode_login_status\']); 
  26.         $this->assign(\'nRememberTime\',$GLOBALS[\'_option_\'][\'remember_time\']); 
  27.         $this->assign(\'arrBindeds\',$GLOBALS[\'_cache_\'][\'sociatype\']); 
  28.         $this->assign(\'sReferer\',$sReferer); 
  29.         $this->assign(\'nRbac\',$nRbac); 
  30.         $this->assign(\'nLoginview\',$nLoginview); 
  31.  
  32.         if($nInajax==1){ 
  33.             $this->display(\'public+ajaxlogin\'); 
  34.         }else
  35.             if($GLOBALS[\'_option_\'][\'only_login_viewsite\']==1){ 
  36.                 $this->display(\'public+loginview\'); 
  37.             }else
  38.                 $this->display(\'public+login\'); 
  39.             } 
  40.         } 
  41.     } 
  42.  
  43.     /* -- more -- */ 
  44.  

视图V:

选自 {windsforce}/upload/app/home/Theme/Default/public_index.html

 


  1. <!--<include file="Core_Extend::template(\'header\')" />--> 
  2.  
  3. <!--{script}--> 
  4. function goodnum(id){} 
  5. <!--{/script}--> 
  6.  
  7. <!--<lang package=\'__COMMON_LANG__@Template/Common\'>-->主页<!--</lang>--> 
  8.  
  9. <!--{:Dyhb::U(\'home://stat/explore\')}--> 
  10.  
  11. <!--<foreach for=arrBindeds value=arrBinded>--> 
  12. <!--{if $i==3}--> 
  13. <div id="socailogin_more" class="none"> 
  14. <!--{/if}--> 
  15. <a style="border-bottom: none;" href="javascript:void(0);" onclick="sociaWinopen(\'<!--{:Dyhb::U(\'home://public/socia_login?vendor=\'.$arrBinded[\'sociatype_identifier\'])}-->\');"><img style="margin:0px 3px 5px 3px; vertical-align: middle;" src="<!--{$arrBinded[\'sociatype_logo\']}-->" /></a> 
  16. <!--{if $i>=3 && $i==count($arrBindeds)}--> 
  17. </div> 
  18. <!--{/if}--> 
  19. <!--</foreach>--> 

选自 {windsforce}/upload/Public/js/common/common.js

 


  1. function ajaxLogin(referer,sUrl){ 
  2.     if(!sUrl){ 
  3.         sUrl=D.U(\'home://public/login?\'+(referer?\'referer=\'+encodeURIComponent(referer):\'\')); 
  4.     } 
  5.  
  6.     windsforceAjax(sUrl,D.L(\'用户登录\',\'__COMMON_LANG__@Js/Common_Js\'),\'\',\'\',\'\',600,200,\'inajax=1\'); 

 

 

 

 安装

  1. 将 DoYouHaoBaby-2.5.1 压缩包解压至一个空文件夹。
  2. DoYouHaoBaby 不需要进行任何特殊的安装,只需要直接部署即可。
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。