2018-06-15 h5开发记录

php加载流程
php - > html -> js+css
php
1.smarty赋值

$smarty->assign("loadMsg",array('pic'=>'error','footDesc'=>'ec:'.$res));
$smarty->caching = false;

2.发起请求

$url = Config::getApiActivityUrl().'/activity/anniversary/getGuestQuestionsDetails?weChatOpenId='.$_COOKIE['openid'].'&devid='.DEVID.'&tsno='.NUUtil::getTsno();
$res = NUHttpUtil::curlGet($url,null);

3.变量
普通变量

$template_path = "questionnaire/question.html";

静态变量

NULog::getInstance()

4.函数

is_array($res) //判断是否为数组

html
1.html里写入php代码

<{if $loadMsg}>
<{include 'error/loadmsg.html' nocache}>
<{else}>
hello world!res
<{/if}>

你可能感兴趣的:(2018-06-15 h5开发记录)