当前位置: 首页>>代码示例>>PHP>>正文


PHP settype函数代码示例

本文整理汇总了PHP中settype函数的典型用法代码示例。如果您正苦于以下问题:PHP settype函数的具体用法?PHP settype怎么用?PHP settype使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了settype函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Savant2_Plugin

 /**
  * 
  * Constructor.
  * 
  * @access public
  * 
  */
 function Savant2_Plugin($conf = array())
 {
     settype($conf, 'array');
     foreach ($conf as $key => $val) {
         $this->{$key} = $val;
     }
 }
开发者ID:Dolfanuk55,项目名称:Kingdoms,代码行数:14,代码来源:Plugin.php

示例2: editAction

 /**
  * 编辑用户组
  */
 public function editAction()
 {
     list($gid, $category, $isManage) = $this->getInput(array('gid', 'category', 'manage'), 'get');
     settype($isManage, 'boolean');
     //权限分类
     $topLevelCategories = $this->_getPermissionService()->getTopLevelCategories($isManage);
     $category or $category = key($topLevelCategories);
     $permissionConfigs = $topLevelCategoryClasses = array();
     foreach ($topLevelCategories as $k => $v) {
         $topLevelCategoryClasses[$k] = $category == $k ? ' class="current"' : '';
         //TODO
         $permissionConfigs[$k] = $this->_getPermissionService()->getPermissionConfigByCategory($gid, $k);
     }
     //group info
     $group = $this->_getGroupDs()->getGroupByGid($gid);
     $groupTypes = $isManage ? array('system', 'special') : array('member', 'default', 'system', 'special');
     $groups = array();
     foreach ($groupTypes as $v) {
         $groups += $this->_getGroupDs()->getGroupsByTypeInUpgradeOrder($v);
     }
     $this->setOutput($groups, 'groups');
     $this->setOutput($gid, 'gid');
     $this->setOutput($isManage, 'isManage');
     $this->setOutput($category, 'category');
     $this->setOutput($group, 'group');
     $this->setOutput($topLevelCategoryClasses, 'topLevelCategoryClasses');
     $this->setOutput($topLevelCategories, 'topLevelCategories');
     $this->setOutput($permissionConfigs, 'permissionConfigs');
 }
开发者ID:YoursBoss,项目名称:nextwind,代码行数:32,代码来源:GroupsController.php

示例3: next

 /**
  * Iterator function. Returns a rowset if called without parameter,
  * the fields contents if a field is specified or FALSE to indicate
  * no more rows are available.
  *
  * @param   string field default NULL
  * @return  var
  */
 public function next($field = NULL)
 {
     if (!is_resource($this->handle) || FALSE === ($row = mssql_fetch_assoc($this->handle))) {
         return FALSE;
     }
     foreach ($row as $key => $value) {
         if (NULL === $value || !isset($this->fields[$key])) {
             continue;
         }
         switch ($this->fields[$key]) {
             case 'datetime':
                 $row[$key] = Date::fromString($value, $this->tz);
                 break;
             case 'numeric':
                 if (FALSE !== strpos($value, '.')) {
                     settype($row[$key], 'double');
                     break;
                 }
                 // Fallthrough intentional
             case 'int':
                 if ($value <= LONG_MAX && $value >= LONG_MIN) {
                     settype($row[$key], 'integer');
                 } else {
                     settype($row[$key], 'double');
                 }
                 break;
         }
     }
     if ($field) {
         return $row[$field];
     } else {
         return $row;
     }
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:42,代码来源:MsSQLResultSet.class.php

示例4: content_5507f549f120e0_03576615

    function content_5507f549f120e0_03576615($_smarty_tpl)
    {
        ?>
<section>
	<?php 
        if ($_smarty_tpl->tpl_vars['role']->value == 'admin') {
            ?>
	<h1>Moje zamówienia</h1>
	<table cellspacing="10px">
		<th>nr zamówienia</th>
		<th>data zamówienia</th>
		<th>ilość produktów</th>
		<th>cena</th>
	<?php 
            $_smarty_tpl->tpl_vars['p'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['p']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['order_tab']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['p']->key => $_smarty_tpl->tpl_vars['p']->value) {
                $_smarty_tpl->tpl_vars['p']->_loop = true;
                ?>
	
		
				<tr>
				<td><?php 
                echo $_smarty_tpl->tpl_vars['p']->value['id_order'];
                ?>
 </td>
				<td><?php 
                echo $_smarty_tpl->tpl_vars['p']->value['date'];
                ?>
 </td>
				<td><?php 
                echo $_smarty_tpl->tpl_vars['p']->value['amount_of_products'];
                ?>
 </td>
				<td><?php 
                echo $_smarty_tpl->tpl_vars['p']->value['value'];
                ?>
 </td>
				<td><a href="admin/order_detail/<?php 
                echo $_smarty_tpl->tpl_vars['p']->value['id_order'];
                ?>
">Pokaż szczegóły</a></td> 
				</tr>
	<?php 
            }
            ?>
	</table>
	<?php 
        } else {
            ?>
	<meta http-equiv="refresh" content="0; URL=index.php">
	<?php 
        }
        ?>
</section><?php 
    }
开发者ID:limackk,项目名称:OnlineShop,代码行数:60,代码来源:128975f8d981bddb2464cf697923e3934992760e.file.my_order.tpl.php

示例5: content_561f47a1b51574_17477137

    function content_561f47a1b51574_17477137($_smarty_tpl)
    {
        ?>


	<?php 
        $_smarty_tpl->tpl_vars['one_day'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['one_day']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['days_datas']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['one_day']->key => $_smarty_tpl->tpl_vars['one_day']->value) {
            $_smarty_tpl->tpl_vars['one_day']->_loop = true;
            ?>
	<p>
		<strong class="dark"><?php 
            echo smartyTranslate(array('s' => $_smarty_tpl->tpl_vars['one_day']->value['day']), $_smarty_tpl);
            ?>
: </strong> &nbsp;<span><?php 
            echo $_smarty_tpl->tpl_vars['one_day']->value['hours'];
            ?>
</span>
	</p>
	<?php 
        }
        ?>

<?php 
    }
开发者ID:ravigupta9363,项目名称:mangwale,代码行数:30,代码来源:63b139e9ec06a3f32e60e8a1d13e9a0f2fc35e72.file.store_infos.tpl.php

示例6: content_55d7ea60b9e494_00271329

    function content_55d7ea60b9e494_00271329($_smarty_tpl)
    {
        if (!is_callable('smarty_function_link')) {
            include 'F:\\chengshuang\\php\\ejw\\system\\plugins/smarty\\function.link.php';
        }
        ?>
 
<?php 
        $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['item']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['data']->value['article'];
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
            $_smarty_tpl->tpl_vars['item']->_loop = true;
            ?>
<li><a target='_blank' href="<?php 
            echo smarty_function_link(array('ctl' => 'content:detail', 'arg0' => $_smarty_tpl->tpl_vars['item']->value['article_id']), $_smarty_tpl);
            ?>
" title="<?php 
            echo $_smarty_tpl->tpl_vars['item']->value['title'];
            ?>
" target="_blank"><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['title'];
            ?>
</a></li>
<?php 
        }
    }
开发者ID:a195474368,项目名称:ejiawang,代码行数:30,代码来源:f04b7710b1beb4853e5e1c9525277cd0cbdcb829.widget.randitems.html.php

示例7: content_5613b5e1523ee0_49514392

    function content_5613b5e1523ee0_49514392($_smarty_tpl)
    {
        if (count($_smarty_tpl->tpl_vars['infos']->value) > 0) {
            ?>
<!-- MODULE Block cmsinfo -->
<div id="cmsinfo_block">
		<?php 
            $_smarty_tpl->tpl_vars['info'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['info']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['infos']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['info']->key => $_smarty_tpl->tpl_vars['info']->value) {
                $_smarty_tpl->tpl_vars['info']->_loop = true;
                ?>
			<div class="col-xs-6"><?php 
                echo $_smarty_tpl->tpl_vars['info']->value['text'];
                ?>
</div>
		<?php 
            }
            ?>
</div>
<!-- /MODULE Block cmsinfo -->
<?php 
        }
    }
开发者ID:pgurdek,项目名称:xa,代码行数:28,代码来源:251b4d1f779d2d35ff649dbf37ade8c9c7ba851a.file.blockcmsinfo.tpl.php

示例8: content_56755e7c23f3c

    function content_56755e7c23f3c($_smarty_tpl)
    {
        ?>
<div class="detailViewInfo"><table class="table table-bordered equalSplit detailview-table" style="table-layout:fixed"><?php 
        $_smarty_tpl->tpl_vars['FIELD_MODEL'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['FIELD_MODEL']->_loop = false;
        $_smarty_tpl->tpl_vars['FIELD_NAME'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['RECORD_STRUCTURE']->value['TOOLTIP_FIELDS'];
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $_smarty_tpl->tpl_vars['smarty']->value['foreach']['fieldsCount']['index'] = -1;
        foreach ($_from as $_smarty_tpl->tpl_vars['FIELD_MODEL']->key => $_smarty_tpl->tpl_vars['FIELD_MODEL']->value) {
            $_smarty_tpl->tpl_vars['FIELD_MODEL']->_loop = true;
            $_smarty_tpl->tpl_vars['FIELD_NAME']->value = $_smarty_tpl->tpl_vars['FIELD_MODEL']->key;
            $_smarty_tpl->tpl_vars['smarty']->value['foreach']['fieldsCount']['index']++;
            if ($_smarty_tpl->getVariable('smarty')->value['foreach']['fieldsCount']['index'] < 7) {
                ?>
<tr><td class="fieldLabel narrowWidthType" nowrap><label class="muted"><?php 
                echo vtranslate($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('label'), $_smarty_tpl->tpl_vars['MODULE']->value);
                ?>
</label></td><td class="fieldValue narrowWidthType"><span class="value"><?php 
                echo $_smarty_tpl->getSubTemplate(vtemplate_path($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getUITypeModel()->getDetailViewTemplateName(), $_smarty_tpl->tpl_vars['MODULE_NAME']->value), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('FIELD_MODEL' => $_smarty_tpl->tpl_vars['FIELD_MODEL']->value, 'USER_MODEL' => $_smarty_tpl->tpl_vars['USER_MODEL']->value, 'MODULE' => $_smarty_tpl->tpl_vars['MODULE_NAME']->value, 'RECORD' => $_smarty_tpl->tpl_vars['RECORD']->value), 0);
                ?>
</span></td></tr><?php 
            }
        }
        ?>
</table></div>
<?php 
    }
开发者ID:wsLapshin,项目名称:charter_crm,代码行数:31,代码来源:f85d624f9461d96296a8f8ee26ce1a5163633bd0.file.TooltipContents.tpl.php

示例9: content_5598e703ef0372_76137591

    function content_5598e703ef0372_76137591($_smarty_tpl)
    {
        ?>
<div class="panel kpi-container">
	<div class="row">
		<?php 
        $_smarty_tpl->tpl_vars['kpi'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['kpi']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['kpis']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['kpi']->key => $_smarty_tpl->tpl_vars['kpi']->value) {
            $_smarty_tpl->tpl_vars['kpi']->_loop = true;
            ?>
		<div class="col-sm-6 col-lg-3">
			<?php 
            echo $_smarty_tpl->tpl_vars['kpi']->value;
            ?>

		</div>			
		<?php 
        }
        ?>
	</div>
</div><?php 
    }
开发者ID:habypk,项目名称:zocart,代码行数:27,代码来源:55d3b32629987e5251c47c88f3146f81de234150.file.row.tpl.php

示例10: generaPaginacion

 public function generaPaginacion($totalRows, $back, $next, $url, $class = "")
 {
     settype($totalRows, "integer");
     $this->totalRows = $totalRows;
     $this->lassLink = $class;
     $this->url = $url;
     $this->numPages = ceil($totalRows / $this->quantity);
     if ($this->page > 0) {
         $this->puri = $this->page - 1;
         //echo "<a href='".$this->url."page=".$this->puri."'>".$back."</a>";
         echo "<a href='" . $this->url . $this->puri . "' class='avance'>\n\t\t\t\t\t  <div class='triangulo-azul-izq'></div>Anterior\n\t\t\t      </a>";
     }
     echo "<div class='pleca-vertical'></div>\n\t\t\t      <div class='texto-pagina'>Página:</div>";
     if ($this->numPages > 1) {
         for ($i = 0; $i < $this->numPages; $i++) {
             if ($i == $this->page) {
                 echo "<span class='actual'>" . ($i + 1) . "</span>";
             } elseif ($i == $this->page + 1 || $i == $this->page + 2 || $i == $this->page - 1 || $i == $this->page - 2) {
                 //$page + 1, $page +2 son los numeros que se desea ver por delante del actual
                 //$page -1, $page -2 son los numeros (Links) a ver por detras del actual
                 //Esto se puede modificar como se desee
                 echo " <a class='avance padding-texto' href='" . $this->url . $i . "'>" . ($i + 1) . "</a>";
             } elseif ($i == $this->page - 3) {
                 //echo "<div style='float: left'>..</div>";
             } elseif ($i == $this->page + 3) {
                 //echo "<div style='float: left'>..</div>";
             }
         }
     }
     echo "<div class='pleca-vertical'></div>";
     if ($this->page < $this->numPages - 1) {
         $this->puri = $this->page + 1;
         echo "<a href='" . $this->url . $this->puri . "'><div class='avance'>Siguiente</div><div class='triangulo-azul-der'></div></a>";
     }
 }
开发者ID:heladiofog,项目名称:tienda0mx,代码行数:35,代码来源:paginacion.php

示例11: convert

 public function convert($value)
 {
     if (!settype($value, $this->type)) {
         throw new ValueConverterException('Converting %s to type ');
     }
     return $value;
 }
开发者ID:idr0id,项目名称:papper,代码行数:7,代码来源:TypeValueConverter.php

示例12: content_548e78e437efc6_19597833

    function content_548e78e437efc6_19597833($_smarty_tpl)
    {
        ?>
<ul class="ow_console_lang">
    <?php 
        $_smarty_tpl->tpl_vars["language"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["language"]->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['languages']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["language"]->key => $_smarty_tpl->tpl_vars["language"]->value) {
            $_smarty_tpl->tpl_vars["language"]->_loop = true;
            ?>
        <li class="ow_console_lang_item" onclick="location.href='<?php 
            echo $_smarty_tpl->tpl_vars['language']->value['url'];
            ?>
';"><span class="<?php 
            echo $_smarty_tpl->tpl_vars['language']->value['class'];
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['language']->value['label'];
            ?>
</span></li>
    <?php 
        }
        ?>
</ul><?php 
    }
开发者ID:jorgemunoz8807,项目名称:havanabook,代码行数:29,代码来源:d6f28fb38c6b2a010fbd82b22c4153f75b7bb829.file.switch_language.html.php

示例13: content_5608824d277c26_21258064

    function content_5608824d277c26_21258064($_smarty_tpl)
    {
        ?>
<div class="box">
	<div class="box-header">
		<h3 class="box-title">Lista de servicios</h3>
	</div><!-- /.box-header -->
	<div class="box-body">
		<table id="btlServicios" class="table table-bordered table-hover">
			<thead>
				<tr>
					<th>#</th>
					<th>Nombre</th>
					<th>Tipo</th>
					<th>&nbsp;</th>
				</tr>
			</thead>
			<tbody>
				<?php 
        $_smarty_tpl->tpl_vars["row"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["row"]->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['lista']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["row"]->key => $_smarty_tpl->tpl_vars["row"]->value) {
            $_smarty_tpl->tpl_vars["row"]->_loop = true;
            ?>
					<tr>
						<td><?php 
            echo $_smarty_tpl->tpl_vars['row']->value['idServicio'];
            ?>
</td>
						<td><?php 
            echo $_smarty_tpl->tpl_vars['row']->value['nombre'];
            ?>
</td>
						<td><?php 
            echo $_smarty_tpl->tpl_vars['row']->value['descripcion'];
            ?>
</td>
						<td style="text-align: right">
							<button type="button" class="btn btn-success btn-circle" action="modificar" title="Modificar" datos='<?php 
            echo $_smarty_tpl->tpl_vars['row']->value['json'];
            ?>
'><i class="fa fa-pencil"></i></button>
							<button type="button" class="btn btn-danger btn-circle" action="eliminar" title="Eliminar" identificador="<?php 
            echo $_smarty_tpl->tpl_vars['row']->value['idServicio'];
            ?>
"><i class="fa fa-times"></i></button>
						</td>
					</tr>
				<?php 
        }
        ?>
			</tbody>
		</table>
	</div>
</div><?php 
    }
开发者ID:hugooluisss,项目名称:registroDoctores,代码行数:60,代码来源:53005aee9d52f9d01a58df1a6638b45112a1ffed.file.lista.tpl.php

示例14: SaveConfig

 public function SaveConfig($sMode)
 {
     $this->Security_ValidateSendForm();
     $aConfigSet = array();
     foreach ($this->aFields[$sMode] as $sName => $aField) {
         if ($aField['type'] != 'section') {
             $aConfigField['key'] = 'config.all.' . $aField['config'];
             if (!isset($_POST[$sName]) || !$_POST[$sName]) {
                 if (isset($aField['empty'])) {
                     $aConfigField['val'] = $aField['empty'];
                 } else {
                     if ($aField['valtype'] == 'boolean') {
                         $val = false;
                     } else {
                         $val = '';
                     }
                 }
             } else {
                 $val = $_POST[$sName];
                 settype($val, $aField['valtype']);
             }
             $aConfigField['val'] = serialize($val);
             $aConfigSet[] = $aConfigField;
         }
     }
     $sDataFile = $this->PluginAceadminpanel_Admin_GetCustomConfigFile();
     if ($this->PluginAceAdminPanel_Admin_SetValueArray($aConfigSet)) {
         $aConfigSet = $this->PluginAceAdminPanel_Admin_GetValueArrayByPrefix('config.all.');
         file_put_contents($sDataFile, serialize($aConfigSet));
         $this->oAdminAction->Message('notice', $this->Lang_Get('adm_saved_ok'), null, true);
     } else {
         $this->oAdminAction->Message('error', $this->Lang_Get('adm_saved_err'), null, true);
     }
     admHeaderLocation(Router::GetPath('admin') . 'site/settings/' . $this->sMenuNavItemSelect);
 }
开发者ID:lifecom,项目名称:test,代码行数:35,代码来源:ActionAdminSiteSettings.class.php

示例15: populateArgs

 /**
  * Basic sanitisation of request input data.
  * Ensures that all expected arguments are present and of the correct data type.
  * Removes any arguments from the array that were not expected.
  * @param $args array Would normally be $_REQUEST, $_POST or similar.
  */
 public function populateArgs($args)
 {
     unset($args['module']);
     //once we're here we know what module & lib we're in, so can drop those args.
     unset($args['lib']);
     $expected = $this->expectedArgs();
     $expected['paGame'] = array('default' => paConfig::getGame());
     $this->args = $args;
     //compare args we've been given with the ones we expect.
     //drop any args we weren't expecting.
     foreach (array_keys($this->args) as $key) {
         if (!isset($expected[$key])) {
             unset($this->args[$key]);
         }
     }
     //and for the ones we are expecting, make sure they meet expectations.
     foreach ($expected as $key => $props) {
         $defvalue = $this->defaultValue($props);
         $deftype = $this->defaultType($props);
         if (!isset($this->args[$key])) {
             $this->args[$key] = $defvalue;
         }
         if ($deftype && isset($this->args[$key])) {
             settype($this->args[$key], $deftype);
         }
         $this->validateArg($key, $props);
     }
     if (count($this->errorData)) {
         throw new paException('Invalid arguments', $this->errorData);
     }
 }
开发者ID:yatan,项目名称:JiGS-PHP-RPG-engine,代码行数:37,代码来源:paBase.class.php


注:本文中的settype函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。