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


PHP Attribute::set方法代码示例

本文整理汇总了PHP中Attribute::set方法的典型用法代码示例。如果您正苦于以下问题:PHP Attribute::set方法的具体用法?PHP Attribute::set怎么用?PHP Attribute::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Attribute的用法示例。


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

示例1: loadAttribute

 /**
  * The addictional attribute loader. It loads an attribute object from
  * database using the attribute name as search key
  *
  * @access	public
  * @return  Attribute the loaded attribute or false if sometring wrong.
  * @since	0.7
  */
 function loadAttribute($name)
 {
     jincimport('utility.servicelocator');
     $servicelocator = ServiceLocator::getInstance();
     $logger = $servicelocator->getLogger();
     $query = 'SELECT id, description, type, table_name, name_i18n ' . 'FROM #__jinc_attribute ' . 'WHERE name = \'' . $name . '\'';
     $logger->debug('NewsletterFactory: Executing query: ' . $query);
     $dbo =& JFactory::getDBO();
     $dbo->setQuery($query);
     // Loading newsletter information from database
     if ($result = $dbo->loadAssocList()) {
         if (empty($result)) {
             // Newsletter not found in database
             $logger->finer('NewsletterFactory: Attribute not found');
             return false;
         }
         $attr = $result[0];
         $attribute = new Attribute($attr['id']);
         $attribute->set('name', $name);
         $attribute->set('description', $attr['description']);
         $attribute->set('type', $attr['type']);
         $attribute->set('table_name', $attr['table_name']);
         $attribute->set('name_i18n', $attr['name_i18n']);
         return $attribute;
     }
     return false;
 }
开发者ID:madseller,项目名称:coperio,代码行数:35,代码来源:newsletterfactory.php

示例2: JINCInputMinimal

                    </td>
                </tr>
                <?php 
    $i++;
}
?>


            <?php 
jincimport('frontend.jincinputstandard');
jincimport('frontend.jincinputminimal');
$renderer = $input_style == INPUT_STYLE_MINIMAL ? new JINCInputMinimal() : new JINCInputStandard();
$renderer->preRender();
if ($public) {
    $attribute = new Attribute(-1);
    $attribute->set('name', 'user_mail');
    $attribute->set('type', ATTRIBUTE_TYPE_EMAIL);
    $attribute->set('name_i18n', 'COM_JINC_USERMAIL');
    $renderer->modRender($attribute, TRUE);
}
foreach ($attributes as $attr_name => $attr_value) {
    $attr = $ninstance->loadAttribute($attr_name);
    $renderer->modRender($attr, $attr_value == ATTRIBUTE_MANDATORY);
}
?>

            <?php 
if ($captcha) {
    $renderer->modCaptchaRender();
}
?>
开发者ID:sulicz,项目名称:JINC_J30,代码行数:31,代码来源:default.php

示例3: setCookie

 /**
  * @param        $name
  * @param null   $value
  * @param int    $expire
  * @param string $path
  * @param null   $domain
  * @param bool   $secure
  * @param bool   $httpOnly
  * @return CookiesAttribute
  */
 public function setCookie($name, $value = null, $expire = 0, $path = '/', $domain = null, $secure = false, $httpOnly = false)
 {
     setcookie($name, $value, $expire, $path, $domain, $secure, $httpOnly);
     return parent::set($name, $value);
 }
开发者ID:RunnerLee,项目名称:http,代码行数:15,代码来源:CookiesAttribute.php

示例4: getName

 /**
  * Return name
  *
  * @return string
  */
 public function getName()
 {
     //$this->log_debug("At getName() in Candidate");
     $name = $this->get("name");
     if ($name) {
         return $name;
     }
     $first = $this->get("firstName");
     $middle = $this->get("middleName");
     $last = $this->get("lastName");
     $name .= $first;
     if ($middle) {
         $name .= " {$middle}";
     }
     if ($last) {
         $name .= " {$last}";
     }
     $name_attr = $this->_fields["name"];
     if (!$name_attr) {
         $name_attr = new Attribute();
         $this->_fields["name"] = $name_attr;
     }
     $name_attr->set("value", $name);
     //parent::set("name",$name); //no re-setting sub-names
     return $name;
 }
开发者ID:davenorthcreek,项目名称:stratum,代码行数:31,代码来源:Candidate.php


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