本文整理汇总了PHP中a_函数的典型用法代码示例。如果您正苦于以下问题:PHP a_函数的具体用法?PHP a_怎么用?PHP a_使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了a_函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: content_tag
<?php
}
?>
<li>
<?php
// We want to eliminate jQuery helpers, but writing this link as raw HTML is tricky because
?>
<?php
// of the need to quote the title option right. And link_to doesn't like '#' as a URL. So we use
?>
<?php
// content_tag, Symfony's lower-level helper for outputting any tag and its content programmatically
?>
<?php
echo content_tag('a', '<span class="icon"></span>' . (isset($label) ? a_($label) : a_("Edit")), array('href' => '#edit-slot-' . $pageid . '-' . $name . '-' . $permid, 'id' => "a-slot-edit-{$pageid}-{$name}-{$permid}", 'class' => isset($class) ? $class : 'a-btn icon a-edit', 'title' => isset($title) ? $title : a_('Edit')));
?>
<?php
a_js_call('apostrophe.slotEnableEditButton(?, ?, ?, ?, ?)', $pageid, $name, $permid, url_for($slot->type . 'Slot/ajaxEditView'), aTools::getRealUrl());
?>
</li>
<?php
if ($controlsSlot) {
?>
<?php
end_slot();
?>
<?php
}
示例2: link_to
?>
<?php
echo link_to('<span class="icon"></span>' . a_get_option($options, 'chooseLabel', a_('Choose Images')), 'aMedia/select', array('query_string' => http_build_query(array_merge($options['constraints'], array("multiple" => true, "aMediaIds" => implode(",", $itemIds), "type" => "image", "label" => a_get_option($options, 'browseLabel', a_('You are creating a slideshow of images.')), "after" => url_for("aSlideshowSlot/edit") . "?" . http_build_query(array("slot" => $name, "slug" => $slug, "permid" => $permid, "noajax" => 1))))), 'class' => 'a-btn icon a-media a-inject-actual-url'));
?>
<?php
aRouteTools::popTargetEnginePage('aMedia');
?>
</li>
<?php
include_partial('a/variant', array('pageid' => $pageid, 'name' => $name, 'permid' => $permid, 'slot' => $slot));
?>
<?php
end_slot();
?>
<?php
}
?>
<?php
if (count($items)) {
?>
<?php
include_component('aSlideshowSlot', $options['slideshowTemplate'], array('items' => $items, 'id' => $id, 'options' => $options));
} else {
?>
<?php
include_partial('aImageSlot/placeholder', array('placeholderText' => a_("Choose Photos"), 'options' => $options));
}
示例3: isset
<?php
// Compatible with sf_escaping_strategy: true
$form = isset($form) ? $sf_data->getRaw('form') : null;
$embed = isset($embed) ? $sf_data->getRaw('embed') : null;
$dimensions = isset($dimensions) ? $sf_data->getRaw('dimensions') : null;
$item = isset($item) ? $sf_data->getRaw('item') : null;
?>
<?php
use_helper('a');
?>
<h4 class="a-slot-edit-title"><?php
echo a_('Inset Area Body');
?>
</h4>
<div class="a-form-row a-hidden">
<?php
echo $form->renderHiddenFields();
?>
</div>
<?php
if ($options['value']) {
echo $form['value']->render();
echo $form['value']->renderError();
}
?>
示例4: a_button
?>
<?php
// it is less useful if all of your locations are 'room 150', etc. with no further
?>
<?php
// information. Naturally full addresses work best
?>
<li class="post-location a-ui">
<?php
echo aString::firstLine($aEvent['location']);
?>
<?php
if (sfConfig::get('app_events_google_maps', true)) {
?>
<?php
echo a_button(a_('Google Maps'), url_for('http://maps.google.com/maps?' . http_build_query(array('q' => preg_replace('/\\s+/', ' ', $aEvent['location'])))), array('no-bg', 'alt', 'icon', 'a-google-maps'));
?>
<?php
}
?>
</li>
<?php
}
?>
<?php
/* Events generally don't display the author, but you can if necessary. ?>
<li class="post-author">
<span class="a-blog-item-meta-label"><?php echo __('Posted By:', array(), 'apostrophe') ?></span>
<?php echo ($aEvent->getAuthor()->getName()) ? $aEvent->getAuthor()->getName() : $aEvent->getAuthor() ?>
</li>
示例5: fillExcel
protected function fillExcel(PHPExcel $excel, aPollPoll $poll, aPollBaseForm $fields_form, aPollAnswerForm $answer_form)
{
// loading helpers
sfContext::getInstance()->getConfiguration()->loadHelpers('a');
// file properties
$excel->getProperties()->setCreator("Buddies Sàrl")->setLastModifiedBy($this->getUser()->getGuardUser()->getName())->setTitle(sprintf('Poll %s answers export', $this->poll->getTitle()))->setSubject(sprintf('Poll %s answers export', $this->poll->getTitle()))->setDescription('Export generated at ' . date('l d F Y H:i:s'));
// Header
$names = array(a_('Id'), a_('Posted from'), a_('Submission language'), a_('Submission date'));
$excel->setActiveSheetIndex(0);
$column = 'A';
$row = 1;
$font = 'Arial';
$font_size = 10;
// aPollAnswer fields
foreach ($names as $name) {
$cell = $column . $row;
$excel->getActiveSheet()->setCellValue($cell, $name);
$excel->getActiveSheet()->getColumnDimension($column)->setAutoSize(true);
$excel->getActiveSheet()->getStyle($cell)->getFont()->setName($font);
$excel->getActiveSheet()->getStyle($cell)->getFont()->setSize($font_size);
$excel->getActiveSheet()->getStyle($cell)->getFont()->setBold(true);
$column++;
}
// aPollAnswerField fields
foreach ($fields_form->getFieldsToSave() as $field) {
$cell = $column . $row;
$excel->getActiveSheet()->setCellValue($cell, $fields_form->getWidget($field)->getLabel());
$excel->getActiveSheet()->getColumnDimension($column)->setAutoSize(true);
$excel->getActiveSheet()->getStyle($cell)->getFont()->setName($font);
$excel->getActiveSheet()->getStyle($cell)->getFont()->setSize($font_size);
$excel->getActiveSheet()->getStyle($cell)->getFont()->setBold(true);
$column++;
}
// answers
$answer_fields_to_report = array('id', 'remote_address', 'culture', 'created_at');
$row = 1;
foreach ($poll->getAnswers() as $answer) {
$column = 'A';
$row++;
foreach ($answer_fields_to_report as $field) {
$cell = $column . $row;
$excel->getActiveSheet()->setCellValue($cell, aPollToolkit::renderFormFieldValue($answer_form, $answer_form[$field], $answer->get($field)));
$excel->getActiveSheet()->getStyle($cell)->getFont()->setName($font);
$excel->getActiveSheet()->getStyle($cell)->getFont()->setSize($font_size);
$column++;
}
// building array of answer fields
$answer_fields = $answer->getFields();
$fields = array();
foreach ($answer_fields as $field) {
$fields[$field->getName()] = $field->getValue();
}
// writing values to excel
foreach ($fields_form->getFieldsToSave() as $name) {
$cell = $column . $row;
if (isset($fields[$name])) {
$fields_form_field = $fields_form[$name];
$excel->getActiveSheet()->setCellValue($cell, aPollToolkit::renderFormFieldValue($fields_form, $fields_form_field, $fields[$name]));
$excel->getActiveSheet()->getStyle($cell)->getFont()->setName($font);
$excel->getActiveSheet()->getStyle($cell)->getFont()->setSize($font_size);
}
$column++;
}
}
$excel->setActiveSheetIndex(0);
return $excel;
}
示例6: use_helper
<?php
use_helper('a', 'Date');
?>
<li class="a-admin-action-new"><?php
echo a_js_button(a_('New Post'), array('big', 'icon', 'a-add', 'a-blog-new-post-button'), 'a-blog-new-post-button');
?>
<div class="a-ui a-options a-blog-admin-new-ajax dropshadow">
<?php
include_component('aBlogAdmin', 'newPost');
?>
</div>
</li>
<?php
if (sfConfig::get('app_aBlog_disqus_enabled', true) && sfConfig::get('app_aBlog_disqus_shortname')) {
?>
<li><?php
echo link_to('Comments', 'http://' . sfConfig::get('app_aBlog_disqus_shortname') . '.disqus.com', array('class' => 'a-btn big'));
?>
</li>
<?php
}
示例7: link_to
} else {
?>
<input type="image" src="/apostrophePlugin/images/a-special-blank.gif" class="submit a-search-submit" value="Search Pages" alt="Search" title="Search"/>
<?php
}
?>
</div>
<?php
/* Removed the cancel button because everyone kept clicking cancel instead of search. If you want to get back to media click the media heading. ?>
<div class="a-form-row cancel" id="a-media-video-add-by-embed-form-submit">
<?php echo link_to('<span class="icon"></span>'.a_("Cancel"), 'aMedia/resume', array("class" => "a-btn icon a-cancel")) ?>
</div>
<?php //*/
?>
</form>
</div>
<?php
if (isset($pager)) {
?>
<?php
include_partial('aMedia/videoSearch', array('url' => $url, 'pager' => $pager, 'service' => $service));
?>
<?php
}
?>
</div>
<?php
a_js_call('apostrophe.selfLabel(?)', array('selector' => '#a-media-search-services .a-search-field', 'title' => a_('Search')));
示例8: foreach
?>
<?php
$catClass = "";
foreach ($a_event->getCategories() as $category) {
$catClass .= " category-" . aTools::slugify($category);
}
?>
<div class="a-blog-item event <?php
echo $a_event->getTemplate();
echo $catClass != '' ? $catClass : '';
?>
">
<?php
if ($a_event->userHasPrivilege('edit')) {
?>
<ul class="a-ui a-controls a-blog-post-controls">
<li>
<?php
echo a_button(a_('Edit'), url_for('a_event_admin_edit', $a_event), array('a-btn', 'icon', 'a-edit', 'lite', 'alt', 'no-label'));
?>
</li>
</ul>
<?php
}
?>
<?php
include_partial('aEvent/' . $a_event->getTemplate(), array('a_event' => $a_event, 'edit' => false));
?>
</div>
示例9: i18nDummy
private function i18nDummy()
{
a_('No Author');
}
示例10: a_
<div class="a-form-row by-type title">
<?php
$w = $form['title_or_tag'];
?>
<input type="radio" id="<?php
echo $w->renderId();
?>
-title" name="<?php
echo $w->renderName();
?>
" value="title" <?php
echo $w->getValue() === "title" ? 'checked' : '';
?>
/>
<h4><label for="<?php
echo $w->renderId();
?>
-title"><?php
echo a_('By Title');
?>
</label></h4>
<div class="a-form-row blog-posts">
<?php
echo $form['blog_posts']->render();
?>
</div>
</div>
</div>
<?php
a_js_call('aBlog.slotEditView(?)', array('formName' => $form->getName(), 'autocompleteUrl' => url_for("aBlogAdmin/search"), 'class' => 'blog-posts', 'selfLabelSelector' => '#' . $w->renderId() . '-title', 'debug' => false));
示例11: a_js_button
?>
<?php
// Tom: Just a quick note about this -- Enabling the delete button for singleton slot works, it just clears out the value for that slot instead of deleting the slot.
?>
<li>
<?php
$delete_button_style = sfConfig::get('app_a_delete_button_style', 'no-label');
?>
<?php
$delete_button_id = "a-slot-{$pageid}-{$name}-{$permid}-delete-button";
?>
<?php
echo a_js_button(a_('Delete'), array('icon', 'a-delete', 'alt', $delete_button_style), $delete_button_id, a_('Delete Slot'));
?>
<?php
a_js_call('apostrophe.areaEnableDeleteSlotButton(?)', array('pageId' => $page->id, 'name' => $name, 'permid' => $permid, 'buttonId' => $delete_button_id, 'confirmPrompt' => a_('Are you sure you want to delete this slot?'), "url" => url_for("a/deleteSlot?" . http_build_query(array("id" => $page->id, "name" => $name, "permid" => $permid)))));
?>
</li>
<?php
}
?>
</ul>
<?php
}
?>
<?php
// End Slot Controls
?>
示例12: foreach
">
<?php
foreach ($week as $eventDate => $event) {
?>
<?php
$day_class = date('m', strtotime($eventDate)) == date('m', strtotime($calendar['month'])) ? ' current-month' : ' not-current-month';
?>
<?php
$day_class .= date('mdy', strtotime($eventDate)) == date('mdy') ? ' today' : '';
?>
<?php
$day_class .= date('d', strtotime($eventDate)) == $sf_request->getParameter('day') ? ' selected' : '';
?>
<?php
$day_title = date('mdy', strtotime($eventDate)) == date('mdy') ? a_('Today') : '';
?>
<td class="day day-<?php
echo $d;
echo $day_class;
?>
" title="<?php
echo $day_title;
?>
">
<?php
if (count($event)) {
?>
<a href="<?php
echo url_for(aUrl::addParams($filtersWithoutDate, array('year' => date('Y', strtotime($eventDate)), 'month' => date('m', strtotime($eventDate)), 'day' => date('d', strtotime($eventDate)))));
示例13: slot
<?php
slot('body_class');
?>
a-blog <?php
echo $sf_params->get('module');
?>
<?php
echo $sf_params->get('action');
end_slot();
?>
<?php
slot('a-subnav');
?>
<div class="a-ui a-subnav-wrapper blog clearfix">
<div class="a-subnav-inner">
<?php
include_component('aBlog', 'sidebar', array('params' => $params, 'dateRange' => $dateRange, 'info' => $info, 'url' => 'aEvent/index', 'searchLabel' => a_('Search Events'), 'newLabel' => a_('New Event'), 'newModule' => 'aEventAdmin', 'newComponent' => 'newEvent', 'url' => 'aEvent/index', 'calendar' => $calendar));
?>
</div>
</div>
<?php
end_slot();
?>
<div id="a-blog-main" class="a-blog-main clearfix">
<?php
echo include_partial('aEvent/post', array('a_event' => $aEvent, 'preview' => $preview));
?>
</div>
示例14: a_
<?php
$fields = $configuration->getFormFilterFields($filters);
?>
<?php
if ($appliedFilters) {
?>
<?php
echo a_('You are viewing events');
?>
<?php
} else {
?>
<?php
echo a_('You are viewing all events');
?>
<?php
}
?>
<?php
$n = 1;
foreach ($appliedFilters as $name => $values) {
?>
<?php
$field = $fields[$name];
?>
<?php
echo $field->getConfig('label', $name);
示例15: use_helper
if ($sf_params->get('module') != 'aFeedback') {
use_helper('a');
?>
<div class="a-feedback-footer clearfix" id="a-feedback-footer">
<?php
echo a_js_button(a_('Submit a Bug Report'), array('a-link', 'a-feedback'), 'a-feedback-link');
?>
<div class="a-feedback-form-container clearfix" id="a-feedback-form-container">
<?php
include_partial('aFeedback/feedback', array('form' => new aFeedbackForm(), 'feedbackSubmittedBy' => false, 'failed' => false));
?>
</div>
<?php
if ($reportSubmittedBy = $sf_user->getFlash('reportSubmittedBy')) {
?>
<div class="a-feedback-submitted clearfix"><span class="submitted-by"><?php
echo $reportSubmittedBy;
?>
</span> – <?php
echo a_('Thank you for submitting a bug report.');
?>
</div>
<?php
}
?>
</div>
<?php
a_js_call('aFeedback.feedbackForm(?)', array('url' => url_for('aFeedback/feedback') . "?" . http_build_query(array('section' => $_SERVER['REQUEST_URI']))));
}