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


PHP HHtml::ajaxLink方法代码示例

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


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

示例1: createPageButton

 /**
  * Creates a page button.
  *
  * You may override this method to customize the page buttons.
  * @param string $label the text label for the button
  * @param integer $page the page number
  * @param string $class the CSS class for the page button. This could be 'page', 'first', 'last', 'next' or 'previous'.
  * @param boolean $hidden whether this page button is visible
  * @param boolean $selected whether this page button is selected
  *
  * @return string the generated button
  */
 protected function createPageButton($label, $page, $class, $hidden, $selected)
 {
     $this->ajaxIdCounter++;
     // For Unique Ajax Link IDs
     if ($hidden || $selected) {
         $class .= ' ' . ($hidden ? self::CSS_HIDDEN_PAGE : self::CSS_SELECTED_PAGE);
     }
     $ajaxLink = HHtml::ajaxLink($label, $this->createPageUrl($page), array('success' => "function(html) { jQuery('" . $this->ajaxContentTarget . "').replaceWith(html); }"), array('id' => "siPaginatorLink_" . $page . "_" . $this->ajaxIdCounter));
     return '<li class="' . $class . '">' . $ajaxLink . '</li>';
 }
开发者ID:alefernie,项目名称:intranet,代码行数:22,代码来源:HAjaxLinkPager.php

示例2: array

}
?>

        <div class="clearFloats"></div>

        <?php 
echo CHtml::endForm();
?>

        <?php 
if ($poll->hasUserVoted()) {
    ?>
            <br>
            <?php 
    $voteUrl = CHtml::normalizeUrl(array('/polls/poll/answerReset', 'sguid' => $space->guid, 'pollId' => $poll->id, 'wallType' => Wall::$currentType));
    echo HHtml::ajaxLink(Yii::t('PollsModule.widgets_views_entry', 'Reset my vote'), $voteUrl, array('dataType' => 'json', 'success' => "function(json) { \$('#wallEntry_'+json.wallEntryId).html(parseHtml(json.output)); \$('#wallEntry_'+json.wallEntryId).find(':checkbox, :radio').flatelements(); }"), array('id' => "PollAnswerResetButton_" . $poll->id, 'class' => 'btn btn-danger'));
    ?>
            <br>
        <?php 
}
?>


        <?php 
$this->endContent();
?>

    </div>

</div>
开发者ID:nilBora,项目名称:MVC_teaching_Yii,代码行数:30,代码来源:entry.php

示例3: array

    <?php 
if ($canWrite || $canDelete) {
    ?>

        <ul class="nav nav-pills preferences">
            <li class="dropdown ">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-angle-down"></i></a>

                <ul class="dropdown-menu pull-right">

                    <?php 
    if ($canWrite) {
        ?>
                        <li>
                            <?php 
        echo HHtml::ajaxLink('<i class="fa fa-pencil"></i> ' . Yii::t('CommentModule.widgets_views_showComment', 'Edit'), Yii::app()->createAbsoluteUrl('//comment/comment/edit', array('contentModel' => $comment->object_model, 'contentId' => $comment->object_id, 'id' => $comment->id)), array('success' => "js:function(html){ \$('.preferences .dropdown').removeClass('open'); \$('#comment_editarea_" . $comment->id . "').replaceWith(html); \$('#comment_input_" . $comment->id . "_contenteditable').focus(); }"));
        ?>
                        </li>
                    <?php 
    }
    ?>

                    <?php 
    if ($canDelete) {
        ?>
                        <li>

                            <!-- load modal confirm widget -->
                            <?php 
        $this->widget('application.widgets.ModalConfirmWidget', array('uniqueID' => 'modal_commentdelete_' . $comment->id, 'linkOutput' => 'a', 'title' => Yii::t('CommentModule.widgets_views_showComment', '<strong>Confirm</strong> comment deleting'), 'message' => Yii::t('CommentModule.widgets_views_showComment', 'Do you really want to delete this comment?'), 'buttonTrue' => Yii::t('CommentModule.widgets_views_showComment', 'Delete'), 'buttonFalse' => Yii::t('CommentModule.widgets_views_showComment', 'Cancel'), 'linkContent' => '<i class="fa fa-trash-o"></i> ' . Yii::t('CommentModule.widgets_views_showComment', 'Delete'), 'linkHref' => $this->createUrl("//comment/comment/delete", array('contentModel' => $comment->object_model, 'contentId' => $comment->object_id, 'id' => $comment->id)), 'confirmJS' => "function(html) { \$('#comment_" . $comment->id . "').slideUp(); }"));
        ?>
开发者ID:byronmejia,项目名称:humhub-themes-tq,代码行数:31,代码来源:showComment.php

示例4: array

                    </div>
                    <hr>
                    <div class="row">
                        <div class="col-md-4">
                            <?php 
echo HHtml::ajaxSubmitButton(Yii::t('UserModule.views_auth_login', 'Sign in'), array('//user/auth/login'), array('type' => 'POST', 'success' => 'function(html){ $("#globalModal").html(html); }'), array('class' => 'btn btn-primary', 'id' => 'loginBtn'));
?>
                        </div>
                        <div class="col-md-8 text-right">
                            <small>
                                <?php 
echo Yii::t('UserModule.views_auth_login', 'Forgot your password?');
?>
                                <br/>
                                <?php 
echo HHtml::ajaxLink(Yii::t('UserModule.views_auth_login', 'Create a new one.'), array('//user/auth/recoverPassword'), array('type' => 'POST', 'success' => 'function(html){ $("#globalModal").html(html); }'), array('class' => '', 'id' => 'recoverPasswordBtn'));
?>
                            </small>
                        </div>
                    </div>

                    <?php 
$this->endWidget();
?>
                </div>

                <?php 
if ($canRegister) {
    ?>
                    <div class="tab-pane <?php 
    echo isset($_POST['AccountRegisterForm']) ? "active" : "";
开发者ID:skapl,项目名称:design,代码行数:31,代码来源:login_modal.php

示例5: array

<div class="well well-small" style="display: none;" id="comment_<?php 
echo $id;
?>
">
    <div class="comment" id="comments_area_<?php 
echo $id;
?>
">
        <?php 
if ($isLimited) {
    ?>
            <?php 
    // Create an ajax link, which loads all comments upon request
    $showAllLabel = Yii::t('CommentModule.widgets_views_comments', 'Show all {total} comments.', array('{total}' => $total));
    $reloadUrl = CHtml::normalizeUrl(Yii::app()->createUrl('comment/comment/show', array('model' => $modelName, 'id' => $modelId)));
    echo HHtml::ajaxLink($showAllLabel, $reloadUrl, array('success' => "function(html) { \$('#comments_area_" . $id . "').html(html); }"), array('id' => $id . "_showAllLink", 'class' => 'show show-all-link'));
    ?>
            <hr>
        <?php 
}
?>

        <?php 
foreach ($comments as $comment) {
    ?>
            <?php 
    $this->widget('application.modules_core.comment.widgets.ShowCommentWidget', array('comment' => $comment));
    ?>
        <?php 
}
?>
开发者ID:alefernie,项目名称:intranet,代码行数:31,代码来源:comments.php

示例6: array

<li>
    <?php 
$offLinkId = 'notification_off_' . $content->getUniqueId();
$onLinkId = 'notification_on_' . $content->getUniqueId();
echo HHtml::ajaxLink('<i class="fa fa-bell-slash-o"></i> ' . Yii::t('ContentModule.widgets_views_notificationSwitchLink', 'Turn off notifications'), Yii::app()->createUrl('//wall/content/notificationSwitch', array('id' => $content->id, 'className' => get_class($content), 'switch' => 0)), array('dataType' => 'json', 'type' => 'POST', 'data' => array(Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken), 'success' => "js:function(res){ if (res.success) { \$('#" . $offLinkId . "').hide(); \$('#" . $onLinkId . "').show(); } }"), array('style' => 'display: ' . ($state ? 'block' : 'none'), 'id' => $offLinkId));
?>
    <?php 
echo HHtml::ajaxLink('<i class="fa fa-bell-o"></i> ' . Yii::t('ContentModule.widgets_views_notificationSwitchLink', 'Turn on notifications'), Yii::app()->createUrl('//wall/content/notificationSwitch', array('id' => $content->id, 'className' => get_class($content), 'switch' => 1)), array('dataType' => 'json', 'type' => 'POST', 'data' => array(Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken), 'success' => "js:function(res){ if (res.success) { \$('#" . $onLinkId . "').hide(); \$('#" . $offLinkId . "').show(); } }"), array('style' => 'display: ' . ($state ? 'none' : 'block'), 'id' => 'notification_on_' . $content->getUniqueId()));
?>
</li>
开发者ID:honestgorillas,项目名称:humhub,代码行数:10,代码来源:notificationSwitchLink.php

示例7: array

<?php

/**
 * This view shows the edit link for wall entries.
 * Its used by EditLinkWidget.
 *
 * @property string $id the primary key of the model (e.g. 1)
 * @property string $editRoute the route to the edit action
 * @property HActiveRecordContent $object the record which belongs the edit link to
 *
 * @package humhub.modules_core.wall.widgets
 * @since 0.10
 */
?>
<li>
    <?php 
echo HHtml::ajaxLink('<i class="fa fa-pencil"></i> ' . Yii::t('WallModule.widgets_views_editLink', 'Edit'), Yii::app()->createUrl($editRoute, array('id' => $id, 'wallType' => Wall::$currentType)), array('success' => "js:function(html){ \$('.preferences .dropdown').removeClass('open'); \$('#wall_content_" . $object->getUniqueId() . "').replaceWith(html); }"));
?>
</li>
开发者ID:alefernie,项目名称:intranet,代码行数:19,代码来源:editLink.php

示例8: array

                            
                <?php 
echo $form->textField($model, 'verifyCode', array('class' => 'form-control', 'placeholder' => Yii::t('UserModule.views_auth_recoverPassword', 'enter security code above')));
?>
                <?php 
echo $form->error($model, 'verifyCode');
?>
            </div>

            <hr>
            <?php 
echo HHtml::ajaxSubmitButton(Yii::t('UserModule.views_auth_recoverPassword', 'Reset password'), array('//user/auth/recoverPassword'), array('type' => 'POST', 'success' => 'function(html){ $("#globalModal").html(html); }'), array('class' => 'btn btn-primary', 'id' => 'recoverPasswordBtn'));
?>
            
            <?php 
echo HHtml::ajaxLink(Yii::t('UserModule.views_auth_recoverPassword', 'Back'), array('//user/auth/login'), array('type' => 'POST', 'success' => 'function(html){ $("#globalModal").html(html); }'), array('class' => 'btn btn-primary', 'id' => 'backBtn'));
?>
            <?php 
$this->endWidget();
?>
        </div>

    </div>
</div>    


<script type="text/javascript">
<?php 
if ($form->errorSummary($model) != null) {
    ?>
        $('#password-recovery-form').removeClass('bounceIn');
开发者ID:skapl,项目名称:design,代码行数:30,代码来源:recoverPassword_modal.php

示例9: array

</a> <small><?php 
echo HHtml::timeago($comment->created_at);
?>
</small></h4>
        <span class="content">
            <?php 
print HHtml::enrichText($comment->message);
?>
        </span>

        <?php 
//echo CHtml::link(Yii::t('CommentModule.widgets_views_showComment', "Delete"), '#');
?>

        <div class="wall-entry-controls">
            <?php 
if ($comment->canDelete()) {
    $deleteUrl = CHtml::normalizeUrl(array('//comment/comment/delete', 'model' => $comment->object_model, 'id' => $comment->object_id, 'cid' => $comment->id));
    echo HHtml::ajaxLink(Yii::t('CommentModule.widgets_views_showComment', 'Delete'), $deleteUrl, array('type' => 'POST', 'data' => array(Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken), 'success' => "function(html) { \$('#comments_area_" . $comment->object_model . "_" . $comment->object_id . "').html(html); }"), array('id' => "comment_delete_link" . $comment->id));
    echo " - ";
}
?>

            <?php 
Yii::app()->getController()->widget('application.modules_core.like.widgets.LikeLinkWidget', array('object' => $comment));
?>
        </div>
    </div>
</div>
<hr>
开发者ID:ahdail,项目名称:humhub,代码行数:30,代码来源:showComment.php

示例10: array

<div class="showMore">
    <?php 
echo HHtml::ajaxLink(Yii::t('CommentModule.widgets_views_pagination', "Show %count% more comments", array('%count%' => $moreCount)), $showMoreUrl, array('success' => "function(html) { \$('#comments_area_" . $id . "').find('.showMore').hide(); \$('#comments_area_" . $id . "').prepend(html);    }"), array('id' => $id . "_pagePrevLink"));
?>
    <hr />
</div>
开发者ID:skapl,项目名称:design,代码行数:6,代码来源:showMore.php


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