本文整理汇总了PHP中F::sg方法的典型用法代码示例。如果您正苦于以下问题:PHP F::sg方法的具体用法?PHP F::sg怎么用?PHP F::sg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类F
的用法示例。
在下文中一共展示了F::sg方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$controllerID = trim(Yii::app()->controller->id);
$actionID = trim(Yii::app()->controller->action->id);
$controlerId = strtolower(trim($controlerId));
$actionID = strtolower(trim($actionID));
if ($controllerID == "order" || $controllerID == 'myaddress') {
$this->menuId = F::sg('menu', 'dealerOrderMenu');
} else {
if ($controllerID == "sell") {
$this->menuId = F::sg('menu', 'dealerSellMenu');
//销售管理
} else {
if ($controllerID == "makequery") {
$this->menuId = F::sg('menu', 'dealermakequeryMenu');
//商家查询
} else {
if (in_array($controllerID, array('marketing', 'business'))) {
if ($controllerID == "business" && $actionID == "index") {
$this->menuId = F::sg('menu', 'dealerSidebarMenu');
//我的公司
} else {
$this->menuId = F::sg('menu', 'dealermarketingMenu');
//营销管理
}
} else {
$this->menuId = F::sg('menu', 'dealerSidebarMenu');
}
}
}
}
}
示例2: init
public function init()
{
$user = Yii::app()->user;
$controlerId = Yii::app()->getController()->id;
$controlerId = strtolower(trim($controlerId));
echo $user;
if ($controlerId == 'partner') {
$this->menuId = F::sg('menu', 'partnerSiderMenu');
}
}
示例3: init
public function init()
{
$controlerId = Yii::app()->getController()->id;
$controlerId = strtolower(trim($controlerId));
if ($controlerId == 'servicemain' || $controlerId == 'servicebusiness') {
$this->menuId = F::sg('menu', 'servicerSiderbarMenu');
} elseif ($controlerId == 'servicemarket' || $controlerId == 'servicepromotions') {
$this->menuId = F::sg('menu', 'servicerMarketSiderbarMenu');
}
}
示例4: init
public function init()
{
$identity = Yii::app()->user->identity;
if ($identity == 1) {
$this->menuId = F::sg('menu', 'makermemberSiderbarMenu');
} elseif ($identity == 2) {
$this->menuId = F::sg('menu', 'dealermemberSiderbarMenu');
} else {
$this->menuId = F::sg('menu', 'servicememberSiderbarMenu');
}
}
示例5: getMainMenu
public function getMainMenu()
{
$descendants = array();
$mainMenu = F::sg('menu', 'autodataMenu');
if (empty($mainMenu)) {
return $descendants;
}
$main = Menu::model()->findByPk($mainMenu);
if ($main) {
$descendants = $main->children()->findAll();
}
return $descendants;
}
示例6: getHelp
public function getHelp()
{
$help = array();
$menuID = F::sg('menu', 'helpSiderbarMenu');
if (empty($menuID)) {
return $help;
}
$category = Category::model()->findByPk($menuID);
if ($category != null) {
$help = $category->children()->findAll("if_show=:if_show", array(":if_show" => 1));
}
return $help;
}
示例7: init
public function init()
{
$controlerId = Yii::app()->getController()->id;
$controlerId = strtolower(trim($controlerId));
if ($controlerId == 'makecompany') {
$this->menuId = F::sg('menu', 'makeCompanySiderMenu');
} elseif ($controlerId == 'makeorder') {
$this->menuId = F::sg('menu', 'makeOrderSiderMenu');
} elseif ($controlerId == 'default') {
$this->menuId = F::sg('menu', 'makeSearchSiderMenu');
} elseif (in_array($controlerId, array('salesmanage', 'goodscategory', 'templatemanage'))) {
$this->menuId = F::sg('menu', 'makeGoodsSiderMenu');
} else {
$this->menuId = F::sg('menu', 'makeSiderMenu');
}
}
示例8: init
public function init()
{
$user = Yii::app()->user;
$controlerId = Yii::app()->getController()->id;
$controlerId = strtolower(trim($controlerId));
if ($controlerId == 'quotationsell') {
$this->menuId = F::sg('menu', 'mallQuotationSellSiderbarMenu');
} elseif ($controlerId == 'quotationbuy') {
if ($user->isDealer()) {
$this->menuId = F::sg('menu', 'dealerOrderMenu');
} else {
if ($user->isServicer()) {
$this->menuId = F::sg('menu', 'mallQuotationBuySiderbarMenu');
}
}
}
}
示例9: getMainMenu
public function getMainMenu()
{
$mainMenu = F::sg('menu', 'defaultMainMenu');
$user = Yii::app()->user;
if ($user->isMaker()) {
$mainMenu = F::sg('menu', 'makerMainMenu');
} else {
if ($user->isDealer()) {
$mainMenu = F::sg('menu', 'dealerMainMenu');
} else {
if ($user->isServicer()) {
$mainMenu = F::sg('menu', 'servicerMainMenu');
}
}
}
$main = Menu::model()->findByPk($mainMenu);
$descendants = array();
if ($main) {
$descendants = $main->children()->findAll("if_show=:if_show", array(":if_show" => 1));
}
return $descendants;
}
示例10: init
public function init()
{
parent::init();
$host = Yii::app()->request->hostInfo;
$domain = str_replace('http://', '', $host);
if ($host == 'http://' . F::sg('site', 'shopDomain')) {
Yii::app()->theme = 'store';
} else {
$store = Store::model()->findByAttributes(array('domain' => $domain));
$session = new CHttpSession();
$session->open();
// $session->destroy();
$session['store'] = array('store_id' => $store->store_id, 'name' => $store->name, 'email' => $store->email, 'theme' => $store->theme);
// $store_name = $session['store']; // get session variable 'name1'
// foreach ($session as $name => $value) // traverse all session variables
// $session['name3'] = $value3; // set session variable 'name3'
// echo $store->domain;
// exit;
Yii::app()->theme = $store->theme;
// print_r($_SESSION);
}
// exit;
}
示例11: call
public static function call($service, $params = array())
{
// 缓存时间,大于0时才缓存
$queryCachingDuration = F::sg('cache', 'jpdataCachingDuration');
if ($queryCachingDuration > 0 && self::isCacheService($service)) {
$cache = Yii::app()->cache;
$cache_key = self::createCacheKey($service, $params);
$cache_value = $cache->get($cache_key);
if ($cache_value) {
return $cache_value;
}
}
//依据service调用不同的方法
$result = APIServer::executeService($service, $params);
// 设置缓存
if ($queryCachingDuration > 0 && !empty($result)) {
$cache = Yii::app()->cache;
$cache->set($cache_key, $result);
}
if (is_null($result)) {
$result = array();
}
return $result;
}
示例12: getItemGallery
/**
* get item image gallery
* @return array
* @author milkyway(yhxxlm@gmail.com)
*/
public function getItemGallery()
{
$images = ItemImg::model()->findAllByAttributes(array('item_id' => $this->item_id));
foreach ($images as $k => $v) {
$imageList[] = 'http://' . F::sg('site', 'imageDomain') . '/store/' . $v->store_id . '/item/image/' . $v['url'];
}
return $imageList;
}
示例13:
<!--[if (gt IE 9)|!(IE)]><!--><html lang="en"><!--<![endif]-->
<head>
<title><?php
echo F::sg('seo', 'mainTitle');
?>
</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!--meta info-->
<meta name="author" content="Yincart Team">
<meta name="keywords" content="<?php
echo F::sg('seo', 'mainKwrds');
?>
">
<meta name="description" content="<?php
echo F::sg('seo', 'mainDescr');
?>
">
<link rel="icon" type="image/ico" href="<?php
echo F::themeUrl();
?>
/images/fav.ico">
<!--stylesheet include-->
<link rel="stylesheet" type="text/css" media="all" href="<?php
echo F::themeUrl();
?>
/css/colorpicker.css">
<link rel="stylesheet" type="text/css" media="all" href="<?php
echo F::themeUrl();
?>
/css/flexslider.css">
示例14: init
public function init()
{
if ($this->is_init) {
return;
}
$mainMenu = F::sg('menu', 'defaultMainMenu');
$user = Yii::app()->user;
if ($user->isMaker()) {
$mainMenu = F::sg('menu', 'makerMainMenu');
} else {
if ($user->isDealer()) {
$mainMenu = F::sg('menu', 'dealerMainMenu');
} else {
if ($user->isServicer()) {
$mainMenu = F::sg('menu', 'servicerMainMenu');
}
}
}
$main = Menu::model()->findByPk($mainMenu);
$descendants = array();
if ($main) {
//$descendants = $main->children()->findAll("if_show=:if_show",array(":if_show"=>1));
$descendants = $main->descendants()->findAll("if_show=:if_show", array(":if_show" => 1));
$level = $main->level + 1;
}
$route = Yii::app()->getController()->getRoute();
$activeMainItem = 0;
$activeRouteMainItem = 0;
$firstMainItem = 0;
$currentMainItem = 0;
$mainMenu = array();
$activeSidebarItem = 0;
$sidebarMenu = array();
$findActive = false;
$preLevel = 0;
$preItem = 0;
$active = array();
foreach ($descendants as $n => $descendant) {
$menu = array('label' => $descendant->name, 'url' => $descendant->url ? Yii::app()->request->baseUrl . '/' . $descendant->url : '#', 'active' => false, 'level' => $descendant->level, 'haschild' => false);
// 查找主菜单
if ($descendant->level == $level) {
$currentMainItem = $descendant->id;
// 如果子菜单URL属性与当前路径对应,表示找到当前活动子菜单,则当前的主菜单为活动主菜单
if (!$findActive) {
$activeMainItem = $descendant->id;
// 每次变换主菜单,子菜单重新初始化
$sidebarMenu = array();
// 将主菜单加入到子菜单的第一项
$sidebarMenu[$descendant->id] = $menu;
$sidebarMenu[$descendant->id]['haschild'] = true;
}
// 如果子菜单URL属性与当前路径对应,表示找到当前活动子菜单
if (!$findActive && $this->isItemActive($descendant, $route)) {
$activeRouteMainItem = $descendant->id;
}
if ($firstMainItem == 0) {
$firstMainItem = $descendant->id;
}
// 写主菜单组
$mainMenu[$descendant->id] = $menu;
} else {
if ($currentMainItem == $activeMainItem && $descendant->level > $level) {
// 如果子菜单URL属性与当前路径对应,表示找到当前活动子菜单
if (!$findActive && $this->isItemActive($descendant, $route)) {
$activeSidebarItem = $descendant->id;
//$menu['active'] = true;
$findActive = true;
}
// 子菜单如果有多级,则父级子菜单需要标注为父菜单,切删除最父主菜单
if ($descendant->level > $preLevel && $preLevel != 0) {
$sidebarMenu[$preItem]['haschild'] = true;
unset($sidebarMenu[$currentMainItem]);
}
// 写子菜单组
$sidebarMenu[$descendant->id] = $menu;
$preLevel = $descendant->level;
$preItem = $descendant->id;
}
}
}
if (!$findActive) {
if ($activeRouteMainItem > 0) {
$activeMainItem = $activeRouteMainItem;
} else {
$activeMainItem = $firstMainItem;
}
$sidebarMenu = array();
}
$mainMenu[$activeMainItem]['active'] = true;
if ($findActive) {
$sidebarMenu[$activeSidebarItem]['active'] = true;
}
$active['sidebarMenu'] = $activeSidebarItem;
$active['mainMenu'] = $activeMainItem;
$this->activeMenu = $active;
$this->mainMenu = $mainMenu;
$this->sidebarMenu = $sidebarMenu;
$this->is_init = true;
}
示例15: array
<?php
$action = 'item';
$base_url = 'http://' . F::sg('site', 'imageDomain');
$id = $_SESSION['store']['store_id'];
$type = 'store';
Yii::app()->getClientScript()->registerScript('editorparam', 'window.KEDITOR_PARAM = "action=' . $action . '&base_url=' . $base_url . '&id=' . $id . '&type=' . $type . '"', CClientScript::POS_HEAD);
// Yii::app()->getClientScript()->registerScript('editorparam', 'window.KEDITOR_PARAM = "action=' . $action . '&id=' . $id . '"', CClientScript::POS_HEAD);
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'item-form', 'htmlOptions' => array('enctype' => 'multipart/form-data', 'class' => 'form-horizontal')));
?>
<?php
echo TbHtml::alert(TbHtml::ALERT_COLOR_INFO, '<p class="help-block">带 <span class="required">*</span> 的字段为必填项.</p>');
$this->widget('bootstrap.widgets.TbTabs', array('tabs' => array(array('label' => '基本信息', 'content' => $this->renderPartial("_form_base", array('model' => $model, 'form' => $form), true), 'active' => true), array('label' => '详细描述', 'content' => $this->renderPartial("_form_desc", array("model" => $model, 'form' => $form, 'action' => $action, 'base_url' => $base_url, 'id' => $id, 'type' => $type), true)), array('label' => '其他信息', 'content' => $this->renderPartial("_form_other", array("model" => $model, 'form' => $form), true)), array('label' => '商品类型', 'content' => $this->renderPartial("_form_type", array("model" => $model, 'form' => $form), true)), array('label' => '商品分类', 'content' => $this->renderPartial("_form_categories", array("model" => $model, 'form' => $form), true)), array('label' => '商品图片', 'content' => $this->renderPartial("_form_image", array('image' => $image, 'form' => $form, 'upload' => $upload, 'id' => $id, 'item' => $model), true)))));
?>
<?php
echo TbHtml::formActions(array(TbHtml::submitButton('Submit', array('color' => TbHtml::BUTTON_COLOR_PRIMARY)), TbHtml::resetButton('Reset')));
?>
<?php
$this->endWidget();