本文整理汇总了PHP中Builder::add_constant方法的典型用法代码示例。如果您正苦于以下问题:PHP Builder::add_constant方法的具体用法?PHP Builder::add_constant怎么用?PHP Builder::add_constant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Builder
的用法示例。
在下文中一共展示了Builder::add_constant方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
public function login()
{
Builder::add_meta('robots', 'none', TRUE);
Builder::add_js(array('system/jquery-1.8.3', 'system/wx'));
Builder::add_css(array('system/reset', 'pages/frontend'));
Builder::add_css('pages/frontend-contacts');
Builder::add_constant(array('command' => 'user', 'action' => 'login'));
$this->view('login', array());
}
示例2: contacts
public function contacts()
{
Builder::set_title(get_string('pages', 'feedback'));
Builder::add_meta('robots', 'none', TRUE);
Builder::add_js('system/wx');
Builder::add_css('pages/frontend-contacts');
Builder::add_css('pages/support');
Builder::add_constant(array('COMMAND' => 'home', 'ACTION' => 'set_contact'));
//--------------Contents-----------------
$contents = get_structure('frontend/contact');
$contents = $this->view('contacts', $contents, TRUE);
$nav = array();
$nav[get_string('url_naming', 'home')] = '';
$nav[get_string('url_naming', 'contacts')] = 'special/contact';
//------------------Total page------------
$page = array();
$page['nav'] =& $nav;
$page['content'] = $contents;
$this->view('frontend/frontend', $page);
}
示例3: list__comments
/**
* Created by JetBrains PhpStorm.
* User: Администратор
* Date: 01.07.14
* Time: 1:56
* To change this template use File | Settings | File Templates.
*/
function list__comments($options = array())
{
//Builder::add_css("widgets/list/comments");
Builder::add_constant(array('command_comment' => 'widgets_comments', 'action_comment' => 'set_comment'));
$body = '';
if (!empty($options)) {
uasort($options, 'list__comments_uasort');
$point_list = array();
$tree = array();
foreach ($options as &$value) {
$point_list[$value['id']] =& $value;
}
foreach ($options as &$value) {
if ($value['quote'] > 0) {
$quote = $value['quote'];
if (!isset($point_list[$quote])) {
continue;
}
$point_list[$quote]['next'][] =& $value;
continue;
}
$tree[] =& $value;
}
$body = list__comments_build($tree, 120);
}
$captcha = base_url('/technical/tests/captcha');
$title_comment = get_string('widgets', 'comment_title');
$email = get_string('widgets', 'your_email');
$name = get_string('widgets', 'your_name');
$message = get_string('widgets', 'your_message');
$captcha_info = get_string('widgets', 'captcha_info');
$verification_code = get_string('widgets', 'verification_code');
$clear = get_string('widgets', 'clear');
$comment = get_string('widgets', 'comment');
$cancel = get_string('widgets', 'cancel');
$obligatory_field = get_string('widgets', 'obligatory_field');
$is_not_filled = get_string('widgets', 'is_not_filled');
return <<<EOT
<div class="list-comments">
<br />
<div class="main">
{$body}
<br class="clear" />
</div>
</div>
<div class="comment_form_wrapper">
<noindex>
<form id="comment_form" class="comment_form main">
<h2>{$title_comment}</h2>
<fieldset>
<label>
<input name="name" type="text" data-minlength="2" placeholder="{$name}*" />
</label>
<label>
<input name="email" type="text" data-minlength="4" placeholder="{$email}*" />
</label>
<textarea name="message" placeholder="{$message}*" data-minlength="5" ></textarea>
<div>
<p style="color:#000">{$captcha_info}</p>
<label class="left" style="width: 100px;">
<img id="captcha1" src="{$captcha}" onclick="this.src = '{$captcha}/' + Math.floor(Math.random() * 200);" />
</label>
<label class="left">
<input name="captcha" class="captcha" type="text" data-minlength="4" placeholder="{$verification_code}*" />
</label>
</div>
<br class="clear" />
<br class="clear" />
<div class="buttons-wrapper">
<a class="button3" onClick="document.getElementById('comment_form').reset()">{$clear}</a>
<a class="button3" id="contact-send" onclick="send_comment(\$('#comment_form'), 0); return false;">{$comment}</a>
</div>
</fieldset>
</form>
</noindex>
</div>
<script>
function send_comment(\$element, quote_id) {
var data = {};
data["name"] = \$element.find("input[name='name']").val();
data["email"] = \$element.find("input[name='email']").val();
data["message"] = \$element.find("textarea[name='message']").val();
data["captcha"] = \$element.find("input[name='captcha']").val();
data["quote_id"] = parseInt(quote_id);
var idForm = '#' + \$element.attr('id');
var emptyList = findAnEmptyField(idForm);
if (emptyList.length > 0)
{
var name = emptyList[0].attr("placeholder");
showMessage('<h4>{$obligatory_field} "' + name + '" - {$is_not_filled}!</h4>');
return;
//.........这里部分代码省略.........