• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP escAttr函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: render

    public function render($doctype, $environment)
    {
        $languages = ipContent()->getLanguages();
        $answer = '';
        foreach ($languages as $language) {
            $langValue = '';
            $fieldValue = $this->getValue();
            if (is_array($fieldValue)) {
                if (!empty($fieldValue[$language->getCode()])) {
                    $langValue = $fieldValue[$language->getCode()];
                }
            }
            if (!is_string($langValue)) {
                //just in case we have an array or something else incompatible with below code in the database
                $langValue = '';
            }
            $answer .= '
<div class="input-group">
  <span class="input-group-addon">' . esc($language->getAbbreviation()) . '</span>
  <input ' . $this->getAttributesStr($doctype) . ' class="form-control ' . implode(' ', $this->getClasses()) . '" name="' . escAttr($this->getName() . '[' . $language->getCode() . ']" ') . $this->getValidationAttributesStr($doctype) . ' type="text" value="' . escAttr($langValue) . '" />
</div>
            ';
        }
        return $answer;
    }
开发者ID:Umz,项目名称:ImpressPages,代码行数:25,代码来源:TextLang.php


示例2: render

 public function render($doctype, $environment)
 {
     $input = '<input ' . $this->getAttributesStr($doctype) . ' class="form-control ' . implode(' ', $this->getClasses()) . '" name="' . escAttr($this->getName()) . '" ' . $this->getValidationAttributesStr($doctype) . ' type="text" value="' . escAttr($this->getValue()) . '" />';
     $buttons = '<div class="input-group-btn">
         <button type="button" class="btn btn-default ipsSelectSourceFile"><i class="fa fa-file-o"> </i></button>
         <button type="button" class="btn btn-default ipsRemoveSourceFile"><i class="fa fa-trash-o"> </i></button>
     </div>';
     return '<div class="input-group">' . $input . $buttons . '</div>';
 }
开发者ID:hmuralt,项目名称:DataTableWidget,代码行数:9,代码来源:SingleFile.php


示例3: img

 function img($varname, $default, $width, $height, $class = '', $tagname = 'img')
 {
     $varname = $this->num != -1 ? $varname . '-' . $this->num : $varname;
     $defaultval = ipThemeUrl('assets/') . $default;
     if (array_key_exists($varname, $this->data)) {
         $fileName = $this->data[$varname]['fileName'];
         $transform = array('type' => 'crop', 'x1' => $this->data[$varname]['crop']['x1'], 'y1' => $this->data[$varname]['crop']['y1'], 'x2' => $this->data[$varname]['crop']['x2'], 'y2' => $this->data[$varname]['crop']['y2'], 'width' => $width, 'height' => $height);
         $url = ipFileUrl(ipReflection($fileName, $transform, $fileName));
         $imgdata = escAttr(json_encode($this->data[$varname]));
     } else {
         $url = $defaultval;
         $imgdata = "";
     }
     return "<{$tagname} class=\"ipsEditable {$class}\" data-type=\"Image\" data-varname=\"{$varname}\"\n\t\t\t\t\tdata-cssclass=\"{$class}\" data-image=\"{$imgdata}\" src=\"{$url}\"/>";
 }
开发者ID:greybyte,项目名称:IP-CustomSection,代码行数:15,代码来源:Controller.php


示例4: foreach

<div class="slick">
    <?php 
foreach ($images as $imageKey => $image) {
    ?>
        <div>
            <img data-lazy="<?php 
    echo escAttr($image['imageBig']);
    ?>
" alt="<?php 
    echo escAttr($image['title']);
    ?>
" />
            <?php 
    echo isset($image['description']) ? '<div>' . escAttr($image['description']) . '</div>' : '';
    ?>
        </div>
    <?php 
}
?>
</div>
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:20,代码来源:slider.php


示例5: getAttributesStr

 /**
  * Get field attributes as HTML string
  *
  * @param $doctype \Ip\View doctype constant
  * @return string
  */
 public function getAttributesStr($doctype)
 {
     $answer = '';
     foreach ($this->getAttributes() as $attributeKey => $attributeValue) {
         $answer .= ' ' . htmlspecialchars($attributeKey) . '="' . escAttr($attributeValue) . '"';
     }
     return $answer;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:14,代码来源:Fieldset.php


示例6: esc

                <?php 
            echo $image['nofollow'] ? ' rel="nofollow" ' : '';
            ?>
            <?php 
        }
        ?>
            class="_link"
            title="<?php 
        echo esc($image['title']);
        ?>
"
            data-description="<?php 
        echo isset($image['description']) ? escAttr($image['description']) : '';
        ?>
"
            >
            <img class="_image ipsImage" src="<?php 
        echo escAttr($image['imageSmall']);
        ?>
" alt="<?php 
        echo escAttr($image['title']);
        ?>
" />
        </a>
    </div>
<?php 
    }
    ?>
</div>
<?php 
}
开发者ID:Umz,项目名称:ImpressPages,代码行数:31,代码来源:default.php


示例7: escAttr

if (!empty($description)) {
    ?>
    <meta property="og:description" content="<?php 
    echo escAttr($description);
    ?>
" />
<?php 
}
if (!empty($siteName)) {
    ?>
    <meta property="og:site_name" content="<?php 
    echo escAttr($siteName);
    ?>
" />
<?php 
}
if (!empty($images)) {
    ?>
    <?php 
    foreach ($images as $imageUrl) {
        ?>
        <meta property="og:image" content="<?php 
        echo escAttr($imageUrl);
        ?>
?v=0<?php 
        echo \Ip\ServiceLocator::storage()->get('Ip', 'cacheVersion', 1);
        ?>
" />
    <?php 
    }
}
开发者ID:impresspages-plugins,项目名称:FacebookTags,代码行数:31,代码来源:tags.php


示例8: esc

><a href="#" class="ipsAction" data-method="page" data-params="<?php 
            echo esc(json_encode(array('page' => $page['page'])));
            ?>
"><?php 
            echo esc(isset($page['text']) ? $page['text'] : $page['page']);
            ?>
</a></li>
            <?php 
        }
        ?>
        <?php 
    }
    ?>

        <?php 
    if ($currentPage < $totalPages) {
        ?>
            <li><a href="#" class="ipsAction" data-method="page" data-params="<?php 
        echo escAttr(json_encode(array('page' => $currentPage + 1)));
        ?>
">&raquo;</a></li>
        <?php 
    } else {
        ?>
            <li class="disabled"><a href="#">&raquo;</a></li>
        <?php 
    }
    ?>
    </ul>
<?php 
}
开发者ID:Umz,项目名称:ImpressPages,代码行数:31,代码来源:pagination.php


示例9: __

            break;
        case 'warning':
            $typeLabel = __('Warning', 'Install');
            $class = 'warning';
            break;
        case 'error':
            $typeLabel = __('Error', 'Install');
            $class = 'danger';
            break;
    }
    ?>
        <tr><th><?php 
    echo $row['name'] . (!empty($row['helpUrl']) ? ' <a href="' . $row['helpUrl'] . '" target="_blank">(?)</a>' : '');
    ?>
</th><td class="text-center <?php 
    echo escAttr($class);
    ?>
"><?php 
    echo esc($typeLabel);
    ?>
</td></tr>
    <?php 
}
?>
</table>
<p class="text-right">
    <?php 
if ($showNextStep) {
    ?>
        <a class="btn btn-primary ipsAutoForward" href="?step=3"><?php 
    _e('Next', 'Install');
开发者ID:Umz,项目名称:ImpressPages,代码行数:31,代码来源:system.php


示例10: escAttr

<?php

/**
 * This is an HTML of widget management pupup. Please look at AdminController.php to see how $form variable is created.
 * Feel free to modify this file, but leave intact ID attributes and classes with 'ips' prefix.
 *
 */
?>
<div class="ip ipPluginSlideShowPopup" id="ipSlideShowPopup">
    <div class="modal fade ipsModal">
        <div class="modal-dialog">
            <div class="modal-content">
                    <iframe frameBorder="0" border="0" hspace="0" vspace="0" marginwidth="0" marginheight="0" src="<?php 
echo escAttr($gridUrl);
?>
"></iframe>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" data-dismiss="modal"><?php 
_e('Ok', 'SlideShow');
?>
</button>
                </div>
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                </div>
            </div>
        </div>
    </div>
</div>
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:29,代码来源:editPopup.php


示例11: escAttr

<iframe src="<?php 
echo escAttr($repositoryUrl);
?>
" frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;height:100%;width:100%;position:absolute;top:0px;left:0px;right:0px;bottom:0px">

</iframe>
开发者ID:impresspages-plugins,项目名称:RepositoryManager,代码行数:6,代码来源:index.php


示例12: html

 /**
  * HTML to be displayed in payment selection window. All this HTML will be surrounded by A tag to be clickable.
  * @return string
  */
 public function html()
 {
     return '<img src="' . escAttr($this->icon()) . '" alt="' . escAttr($this->name()) . '" />';
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:8,代码来源:SubscriptionPayment.php


示例13: isset

        echo $nofollow ? ' rel="nofollow" ' : '';
        ?>
        <?php 
    }
    ?>
        title="<?php 
    echo isset($title) ? escAttr($title) : '';
    ?>
"
        data-description="<?php 
    echo isset($description) ? escAttr($description) : '';
    ?>
"
        >
        <img class="ipsImage" src="<?php 
    echo escAttr($imageSmall);
    ?>
" alt="<?php 
    echo isset($title) ? escAttr($title) : '';
    ?>
" title="<?php 
    echo isset($title) ? escAttr($title) : '';
    ?>
" />
    </a>
<?php 
} else {
    ?>
    <div class="ipsImage">&nbsp;</div>
<?php 
}
开发者ID:Umz,项目名称:ImpressPages,代码行数:31,代码来源:default.php


示例14: foreach

<?php

if (!empty($breadcrumb) && is_array($breadcrumb)) {
    ?>
    <ol class="breadcrumb">
        <?php 
    foreach ($breadcrumb as $key => $crumb) {
        ?>
            <li><a href="<?php 
        echo escAttr($crumb['url']);
        ?>
"><?php 
        echo esc($crumb['title']);
        ?>
</a></li>
        <?php 
    }
    ?>
    </ol>
<?php 
}
?>
<h1><?php 
echo esc($title);
?>
</h1>
开发者ID:vizo,项目名称:ImpressPages,代码行数:26,代码来源:header.php


示例15: escAttr

<?php 
if (isset($markerlat)) {
    ?>
    data-markerlat="<?php 
    echo escAttr($markerlat);
    ?>
"
<?php 
}
?>

<?php 
if (isset($markerlng)) {
    ?>
    data-markerlng="<?php 
    echo escAttr($markerlng);
    ?>
"
<?php 
}
?>

style="height: <?php 
echo $height;
?>
;"
data-initialized="0"
class="ipsMap">
</div>
<?php 
if (ipIsManagementState()) {
开发者ID:Umz,项目名称:ImpressPages,代码行数:31,代码来源:default.php


示例16: foreach

?>
</h4>
            </div>
            <div class="modal-body ipsBody">
                <?php 
if (count($createForm->getFieldsets()) > 1) {
    ?>
                    <ul class="nav nav-tabs" role="tablist">
                        <?php 
    foreach ($createForm->getFieldsets() as $key => $fieldset) {
        ?>
                            <li class="<?php 
        echo $key == 0 ? 'active' : '';
        ?>
"><a href="#<?php 
        echo escAttr($fieldset->getAttribute('id'));
        ?>
" role="tab" data-toggle="tab"><?php 
        echo esc($fieldset->getLabel());
        ?>
</a></li>
                            <?php 
        $fieldset->setLabel(' ');
        ?>
                        <?php 
    }
    ?>
                    </ul>
                <?php 
}
?>
开发者ID:Umz,项目名称:ImpressPages,代码行数:31,代码来源:createModal.php


示例17: ipHead

 public static function ipHead($head, $info)
 {
     $relativePath = ipRequest()->getRelativePath();
     $canonicalUrl = null;
     //detect if we need to add canonical meta tag because we are on the home page
     if (ipContent()->getCurrentPage() && ipContent()->getCurrentPage()->getId() == ipContent()->getDefaultPageId() && ipRequest()->getRelativePath() != '') {
         //if current page is the default page of current language and relative path is not empty
         $languages = ipContent()->getLanguages();
         $firstLanguage = $languages[0];
         if (ipContent()->getCurrentLanguage()->getId() == $firstLanguage->getId()) {
             //if current language is the first language, set canonical to the base URL.
             $canonicalUrl = ipConfig()->baseUrl();
         } elseif (ipRequest()->getRoutePath() != '') {
             //if current URL is not equal to the language URL, set canonical as language URL
             $canonicalUrl = ipContent()->getcurrentLanguage()->getLink();
         }
     }
     //detect if we need to add canonical tag because of missing trailing slash
     if (!$canonicalUrl) {
         //if canonicalUrl is not set yet
         if (ipGetOption('Config.trailingSlash', 1) && ipContent()->getCurrentPage()) {
             if (substr($relativePath, -1) != '/') {
                 $canonicalUrl = ipConfig()->baseUrl() . $relativePath . '/';
             }
         } else {
             if (substr($relativePath, -1) == '/') {
                 $canonicalUrl = ipConfig()->baseUrl() . substr($relativePath, 0, -1);
             }
         }
     }
     if ($canonicalUrl) {
         $append = '    <link rel="canonical" href="' . escAttr($canonicalUrl) . '" />' . "\n";
         $head .= $append;
     }
     return $head;
 }
开发者ID:impresspages,项目名称:impresspages,代码行数:36,代码来源:Filter.php


示例18: _e

"><?php 
    _e('Home', 'Ip');
    ?>
</a></li>
<?php 
}
foreach ($pages as $key => $page) {
    ?>
    <?php 
    if ($key < count($pages) - 1) {
        ?>
        <li><a href="<?php 
        echo escAttr($page->getLink());
        ?>
" title="<?php 
        echo escAttr($page->getTitle());
        ?>
"><?php 
        echo esc($page->getTitle());
        ?>
</a></li>
    <?php 
    } else {
        ?>
        <li class="active"><?php 
        echo esc($page->getTitle());
        ?>
</li>
    <?php 
    }
}
开发者ID:Umz,项目名称:ImpressPages,代码行数:31,代码来源:breadcrumb.php


示例19: ipFileUrl

        ?>
                <div class="_file ipsFile">
                    <button type="button" class="close ipsRemove">&times;</button>
                    <div><a target="_blank" class="ipsLink ipsFileName" href="<?php 
        echo ipFileUrl('file/repository/' . $file);
        ?>
"><?php 
        echo esc($file);
        ?>
</a></div>
                    <input type="hidden" name="<?php 
        echo escAttr($inputName);
        ?>
[]"
                           value="<?php 
        echo escAttr($file);
        ?>
"/>
                </div>
            <?php 
    }
    ?>
        <?php 
}
?>
    </div>
    <div class="well _file ipsFile ipsFileTemplate hidden">
        <button type="button" class="close ipsRemove" aria-hidden="true">&times;</button>
        <div><a target="_blank" class="ipsLink ipsFileName" href=""></a></div>
        <input type="hidden" name="" value=""/>
    </div>
开发者ID:Umz,项目名称:ImpressPages,代码行数:31,代码来源:repositoryFile.php


示例20: escAttr

    /** @var $language \Ip\Language */
    ?>
        <?php 
    if (!$language->isVisible()) {
        continue;
    }
    ?>
        <?php 
    $activeClass = $language->isCurrent() ? ' class="active"' : '';
    ?>
        <li <?php 
    echo $activeClass;
    ?>
>
            <a title="<?php 
    echo escAttr($language->getTitle());
    ?>
" href="<?php 
    echo escAttr($language->getLink());
    ?>
">
                <?php 
    echo esc($language->getAbbreviation());
    ?>
            </a>
        </li>
    <?php 
}
?>
</ul>
开发者ID:Umz,项目名称:ImpressPages,代码行数:30,代码来源:languages.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP esc_attr函数代码示例发布时间:2022-05-15
下一篇:
PHP esc函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap