本文整理汇总了PHP中Xml类的典型用法代码示例。如果您正苦于以下问题:PHP Xml类的具体用法?PHP Xml怎么用?PHP Xml使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Xml类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: xml_unserialize
public static function xml_unserialize(&$xml, $isnormal = FALSE)
{
$xml_parser = new Xml($isnormal);
$data = $xml_parser->parse($xml);
$xml_parser->destruct();
return $data;
}
开发者ID:hustshenl,项目名称:yii2-ucenter,代码行数:7,代码来源:Xml.php
示例2: __construct
public function __construct()
{
global $dbconfig;
/*
* ANTIGO METODO ANTES DO XML!!!
* PEGAVA DIRETO DO CONFIGURATIONS.INC.PHP
* if(!isset(self::$conexao))
{
$dsn = "{$dbconfig['driver']}:host={$dbconfig['server']};dbname={$dbconfig['database']}";
}
try
{
self::$conexao = new PDO($dsn,
$dbconfig['user'],
$dbconfig['password'],
$dbconfig['options']);
}
*/
$xml = new Xml(_XML_DB_);
$xml->setConstant();
if (!isset(self::$conexao)) {
$dsn = $xml->dsn();
try {
self::$conexao = new PDO($dsn, USER, PASSWORD);
} catch (PDOException $e) {
$erro = 'Erro: ' . $e->getMessage() . "\n" . $e->getTraceAsString() . "\n";
error_log(date('d-m-Y H:i:s') . '-' . $erro, 3, LOG_FILE);
die($erro);
}
}
}
开发者ID:egbertomonteiro,项目名称:Livraria,代码行数:32,代码来源:Tabela.class.php
示例3: plugin_dst_xml_read
function plugin_dst_xml_read()
{
// Perform the repository lookup and xml creation --- start
$localFile = 'plugins/dst/countries.xml';
$result = array('body' => file_get_contents($localFile));
unset($result['headers']);
// we should take a look the header data and error messages before dropping them. Well, later maybe ;-)
unset($result['error']);
$result = array_shift($result);
if (function_exists('simplexml_load_string')) {
$xml = simplexml_load_string($result);
unset($result);
$dst_array = array();
foreach ($xml as $file) {
$dst_array[] = (array) $file;
}
} else {
include_once 'include/lib.xml.php';
$xml = new Xml();
$dst_array = $xml->parse($result);
$dst_array = array_shift($dst_array);
}
// Perform the repository lookup and xml creation --- end
return $dst_array;
}
开发者ID:phill104,项目名称:branches,代码行数:25,代码来源:functions.inc.php
示例4: import
/**
* undocumented function
*
* @param string $file
* @return void
* @access public
*/
function import($file)
{
$source = file_get_contents($file);
$xml = new Xml($source);
$result = $xml->toArray();
$result = $result['Xmlarchive']['Fileset']['File'];
if (empty($result)) {
return false;
}
$count = 0;
foreach ($result as $smiley) {
$name = $smiley['filename'];
$content = $smiley['content'];
$content = preg_replace('/\\s/', '', $content);
$content = base64_decode($content);
$filePath = SMILEY_PATH . $name;
if (file_exists($filePath)) {
continue;
}
$this->create(array('code' => ':' . r('.gif', '', $name) . ':', 'filename' => $name));
$this->save();
$f = fopen($filePath, 'w+');
fwrite($f, $content);
fclose($f);
$count++;
}
return $count;
}
开发者ID:stripthis,项目名称:donate,代码行数:35,代码来源:smiley.php
示例5: get
public function get(&$accessToken, &$oauthConsumer)
{
// we need the GUID of the user for Yahoo
$guid = $oauthConsumer->get($accessToken->key, $accessToken->secret, 'http://social.yahooapis.com/v1/me/guid');
// Yahoo returns XML, so break it apart and make it an array
$xml = new Xml($guid);
// Or you can convert simply by calling toArray();
$guid = $xml->toArray();
// get them contacts
$contacts = $oauthConsumer->get($accessToken->key, $accessToken->secret, 'http://social.yahooapis.com/v1/user/' . $guid['Guid']['value'] . '/contacts', array('count' => 'max', 'format' => 'xml'));
// return array
$c = array();
// counter
$i = 0;
// new xml object
$xml = new Xml($contacts);
$contacts = $xml->toArray();
// let's break apart Yahoo's contact format and make it our own, extracting what we want
foreach ($contacts['Contacts']['Contact'] as $contact) {
foreach ($contact['Fields'] as $field) {
if ($field['type'] == 'email') {
$c[$i]['Contact']['email'][] = $field['value'];
}
if ($field['type'] == 'name' && isset($c[$i]['Contact']['email'])) {
$firstName = isset($field['Value']['givenName']) ? $field['Value']['givenName'] : '';
$lastName = isset($field['Value']['familyName']) ? $field['Value']['familyName'] : '';
$c[$i]['Contact']['fullName'] = $firstName . ' ' . $lastName;
}
}
$i++;
}
return $c;
}
开发者ID:RobertWHurst,项目名称:Telame,代码行数:33,代码来源:yahoo_consumer.php
示例6: isUpToDate
/**
* Verifica se os menus do banco estão atualizados com os do arquivo
* @param $aDados- array de menus do banco
* @return boolean
*/
public function isUpToDate($aDados)
{
$aDados = Set::combine($aDados, "/Menu/id", "/Menu");
App::import("Xml");
App::import("Folder");
App::import("File");
$sCaminhosArquivos = Configure::read("Cms.CheckPoint.menus");
$oFolder = new Folder($sCaminhosArquivos);
$aConteudo = $oFolder->read();
$aArquivos = Set::sort($aConteudo[1], "{n}", "desc");
if (empty($aArquivos)) {
return false;
}
$oFile = new File($sCaminhosArquivos . $aArquivos[0]);
$oXml = new Xml($oFile->read());
$aAntigo = $oXml->toArray();
foreach ($aDados as &$aMenu) {
$aMenu['Menu']['content'] = str_replace("\r\n", " ", $aMenu['Menu']['content']);
}
if (isset($aAntigo["menus"])) {
$aAntigo["Menus"] = $aAntigo["menus"];
unset($aAntigo["menus"]);
}
if (isset($aAntigo["Menus"])) {
$aAntigo = Set::combine($aAntigo["Menus"], "/Menu/id", "/Menu");
$aRetorno = Set::diff($aDados, $aAntigo);
}
return empty($aRetorno);
}
开发者ID:niltonfelipe,项目名称:e-cidade_transparencia,代码行数:34,代码来源:check_point.php
示例7: index
public function index()
{
$this->load->helper('directory');
$map = directory_map(APPPATH . DS . 'modules', 1);
// get all modules
$module = array();
if (count($map) > 0) {
for ($i = 0; $i < count($map); $i++) {
$file = APPPATH . DS . 'modules' . DS . $map[$i] . DS . $map[$i] . '.xml';
if (file_exists($file)) {
$module[] = $map[$i];
}
}
}
// load modules info
$this->load->library('xml');
$xml = new Xml();
$modules = array();
$j = 0;
for ($i = 0; $i < count($module); $i++) {
$file = APPPATH . DS . 'modules' . DS . $module[$i] . DS . $module[$i] . '.xml';
$data = $xml->parse($file);
if (isset($data['name']) && $data['name'] != '' && isset($data['description']) && $data['description'] != '') {
$modules[$j] = new stdclass();
$modules[$j]->name = $module[$i];
$modules[$j]->title = $data['name'];
$modules[$j]->description = $data['description'];
$modules[$j]->thumb = 'application/modules/' . $module[$i] . '/thumb.png';
$j++;
}
}
// get page layout
$this->load->library('xml');
$xml = new Xml();
$file = APPPATH . DS . 'views' . DS . 'layouts' . DS . 'layouts.xml';
$layouts = $xml->parse($file);
$pages = array();
if (count($layouts)) {
$i = 0;
//echo '<pre>'; print_r($layouts['group']); exit;
foreach ($layouts['group'] as $group) {
if (empty($group['@attributes']['description'])) {
continue;
}
$pages[$i] = new stdClass();
$pages[$i]->name = $group['@attributes']['name'];
$pages[$i]->description = $group['@attributes']['description'];
if (empty($group['@attributes']['icon']) || $group['@attributes']['icon'] == '') {
$pages[$i]->icon = base_url('assets/images/system/home.png');
} else {
$pages[$i]->icon = base_url('assets/images/system/' . $group['@attributes']['icon']);
}
$i++;
}
}
$this->data['pages'] = $pages;
$this->data['modules'] = $modules;
$this->load->view('admin/module/index', $this->data);
}
开发者ID:Nnamso,项目名称:tbox,代码行数:59,代码来源:module.php
示例8: insert_node
function insert_node($newXml)
{
if ($newXml) {
$newNode = new Xml($newXml);
$insertNode = $newNode->documentElement();
$this->xml->documentElement->appendChild($this->xml->importNode($insertNode, true));
}
}
开发者ID:nibble-arts,项目名称:feedback,代码行数:8,代码来源:xml.php
示例9: test_parse_returnsTrue_ifOutputIsValidXml
/**
* parse() should return true if output if well-formed xml
*/
public function test_parse_returnsTrue_ifOutputIsValidXml()
{
$xml = '<?xml version="1.0" encoding="UTF-8"?>' . '<foo>' . '<bar>' . 'baz' . '</bar>' . '<bar>' . 'qux' . '</bar>' . '</foo>';
$data = ['bar' => ['baz', 'qux']];
$response = new Xml();
$this->assertTrue($response->parse($xml));
$this->assertEquals($data, $response->getData());
return;
}
开发者ID:jstewmc,项目名称:api,代码行数:12,代码来源:XmlTest.php
示例10: parse
/**
* parse xml
* 2010-02-07 ms
*/
function parse($file)
{
App::import('Core', 'Xml');
$xml = new Xml($file);
$res = $xml->toArray();
if (!empty($res['Xss']['Attack'])) {
return (array) $res['Xss']['Attack'];
}
return array();
}
开发者ID:robksawyer,项目名称:tools,代码行数:14,代码来源:security_lib.php
示例11: paginate
/**
* paginate
*
* @param mixed $conditions
* @param mixed $fields
* @param mixed $order
* @param integer $limit
* @param integer $page
* @param integer $recursive
* @param array $extract
* @return array
*/
public function paginate($conditions, $fields, $order, $limit, $page, $recursive, $extra)
{
$HttpSocket = new HttpSocket();
$query = array('q' => Set::extract('q', $conditions), 'page' => $page, 'rpp' => $limit, 'lang' => Set::extract('lang', $conditions));
$ret = $HttpSocket->get(self::API_SEARCH, $query);
if ($ret) {
$Xml = new Xml($ret);
return $Xml->toArray();
}
return array();
}
开发者ID:shin1x1,项目名称:findTwitter,代码行数:23,代码来源:twitter.php
示例12: __tickets
/**
* undocumented function
*
* @return void
*/
function __tickets()
{
$this->out('This may take a while...');
$project = @$this->args[1];
$fork = null;
if ($this->Project->initialize(compact('project', 'fork')) === false || $this->Project->current['url'] !== $project) {
$this->err('Invalid project');
return 1;
}
$path = $this->args[2];
$ext = array_pop(explode('.', $path));
if ($ext == 'xml') {
App::import('Xml');
$Xml = new Xml($path);
$rows = array();
$this->out('Importing Data...');
foreach ($Xml->toArray() as $key => $data) {
foreach ($data['Records']['Row'] as $columns) {
$new = array();
foreach ($columns['Column'] as $column) {
if ($column['name'] == 'created' || $column['name'] == 'modified') {
$column['value'] = date('Y-m-d H:i:s', $column['value']);
}
$new[$column['name']] = $column['value'];
}
$new['project_id'] = $this->Project->id;
$this->Ticket->create($new);
if ($this->Ticket->save()) {
$this->out('Ticket ' . $new['number'] . ' : ' . $new['title'] . ' migrated');
sleep(1);
}
}
}
return 0;
}
$File = new File($path);
$data = explode("\n", $File->read());
$fields = explode(',', array_shift($data));
foreach ($fields as $key => $field) {
$fields[$key] = str_replace('"', '', $field);
}
pr($fields);
$result = array();
foreach ($data as $line) {
$values = explode(',', $line);
foreach ($values as $key => $value) {
$field = str_replace('"', '', $fields[$key]);
$result[$field] = str_replace('"', '', $value);
}
}
pr($result);
}
开发者ID:Theaxiom,项目名称:chaw-source,代码行数:57,代码来源:trac.php
示例13: valorFrete
function valorFrete(&$model, $servico, $cepOrigem, $cepDestino, $peso, $maoPropria = false, $valorDeclarado = 0.0, $avisoRecebimento = false)
{
// Validação dos parâmetros
$tipos = array(CORREIOS_SEDEX, CORREIOS_SEDEX_A_COBRAR, CORREIOS_SEDEX_10, CORREIOS_SEDEX_HOJE, CORREIOS_ENCOMENDA_NORMAL);
if (!in_array($servico, $tipos)) {
return ERRO_CORREIOS_PARAMETROS_INVALIDOS;
}
$Validacao = new ValidacaoBehavior();
if (!$Validacao->_cep($cepOrigem, '-') || !$Validacao->_cep($cepDestino, '-')) {
return ERRO_CORREIOS_PARAMETROS_INVALIDOS;
}
if (!is_numeric($peso) || !is_numeric($valorDeclarado)) {
return ERRO_CORREIOS_PARAMETROS_INVALIDOS;
}
if ($peso > 30.0) {
return ERRO_CORREIOS_EXCESSO_PESO;
} elseif ($peso < 0.0) {
return ERRO_CORREIOS_PARAMETROS_INVALIDOS;
}
if ($valorDeclarado < 0.0) {
return ERRO_CORREIOS_PARAMETROS_INVALIDOS;
}
// Ajustes nos parâmetros
if ($maoPropria) {
$maoPropria = 'S';
} else {
$maoPropria = 'N';
}
if ($avisoRecebimento) {
$avisoRecebimento = 'S';
} else {
$avisoRecebimento = 'N';
}
// Requisição
$HttpSocket = new HttpSocket();
$uri = array('scheme' => 'http', 'host' => 'www.correios.com.br', 'port' => 80, 'path' => '/encomendas/precos/calculo.cfm', 'query' => array('resposta' => 'xml', 'servico' => $servico, 'cepOrigem' => $cepOrigem, 'cepDestino' => $cepDestino, 'peso' => $peso, 'MaoPropria' => $maoPropria, 'valorDeclarado' => $valorDeclarado, 'avisoRecebimento' => $avisoRecebimento));
$retornoCorreios = trim($HttpSocket->get($uri));
if ($HttpSocket->response['status']['code'] != 200) {
return ERRO_CORREIOS_FALHA_COMUNICACAO;
}
$Xml = new Xml($retornoCorreios);
$infoCorreios = $Xml->toArray();
if (!isset($infoCorreios['CalculoPrecos']['DadosPostais'])) {
return ERRO_CORREIOS_CONTEUDO_INVALIDO;
}
extract($infoCorreios['CalculoPrecos']['DadosPostais']);
return array('ufOrigem' => $uf_origem, 'ufDestino' => $uf_destino, 'capitalOrigem' => $local_origem == 'Capital', 'capitalDestino' => $local_destino == 'Capital', 'valorMaoPropria' => $mao_propria, 'valorTarifaValorDeclarado' => $tarifa_valor_declarado, 'valorFrete' => $preco_postal - $tarifa_valor_declarado - $mao_propria, 'valorTotal' => $preco_postal);
}
开发者ID:edubress,项目名称:cake_ptbr,代码行数:48,代码来源:correios.php
示例14: restore
/**
* Função para restauração
*/
public function restore()
{
$sDiretorio = Configure::read('Cms.CheckPoint.menus');
if (!is_dir($sDiretorio)) {
$this->Session->setFlash("Diretório das restaurações não configurado.", 'default', array('class' => "alert alert-error"));
$this->redirect(array('controller' => 'dashboard', 'action' => 'index'));
}
/**
* Faz a restauração
*/
if (!empty($this->data)) {
$this->loadModel('Cms.Menu');
App::import('Xml');
$oSnapXml = new Xml($sDiretorio . $this->data['CheckPoint']['snapshot']);
$aSnap = $oSnapXml->toArray();
$aRestore = !empty($aSnap['Menus']) ? $aSnap['Menus']['Menu'] : array();
/**
* Verifica se possui apenas um item de menu no xml e trata de uma forma diferente.
* -- Função de XML do Cake salva de formas diferentes o XML quando possui apenas um item.
*/
if (!empty($aRestore) && !isset($aRestore[0])) {
$aRestore = array($aRestore);
}
$this->CheckPoint->generate();
if ($this->Menu->restauraBackup($aRestore)) {
$this->Session->setFlash("Restaurado com sucesso.", 'default', array('class' => "alert alert-success"));
} else {
$this->Session->setFlash("Erro ao restaurar.", 'default', array('class' => "alert alert-error"));
}
}
/**
* Pega os snapshots salvos e invverte a ordem para exibir do mais novo para o mais antigo
*/
$oFolder = new Folder(Configure::read('Cms.CheckPoint.menus'));
$aFolder = $oFolder->read();
$aFiles = array_reverse($aFolder[1]);
$aSnapshot = array();
foreach ($aFiles as $sFile) {
if (!in_array($sFile, array('.', '..'))) {
$aSnapshot[$sFile] = date('d/m/Y H:i:s', str_replace('.xml', '', $sFile));
}
}
if (empty($aSnapshot)) {
$this->Session->setFlash("Nenhum ponto de restauração encontrado.", 'default', array('class' => "alert alert-error"));
$this->redirect(array('controller' => 'dashboard', 'action' => 'index'));
}
$this->set(compact('aSnapshot'));
}
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:51,代码来源:check_points_controller.php
示例15: getForm
/**
* Displays the reCAPTCHA widget.
* If $this->recaptcha_error is set, it will display an error in the widget.
*
*/
function getForm()
{
global $wgReCaptchaPublicKey, $wgReCaptchaTheme;
$useHttps = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on';
$js = 'var RecaptchaOptions = ' . Xml::encodeJsVar(array('theme' => $wgReCaptchaTheme, 'tabindex' => 1));
return Html::inlineScript($js) . recaptcha_get_html($wgReCaptchaPublicKey, $this->recaptcha_error, $useHttps);
}
开发者ID:eliagbayani,项目名称:LiteratureEditor,代码行数:12,代码来源:ReCaptcha.class.php
示例16: serializeXmlToArray
/**
* Serialize to array data from xml
*
* @param array $url url
* @return array Xml serialize array data
*/
public function serializeXmlToArray($url)
{
$xmlData = Xml::toArray(Xml::build($url));
// rssの種類によってタグ名が異なる
if (isset($xmlData['feed'])) {
$items = Hash::get($xmlData, 'feed.entry');
$dateKey = 'published';
$linkKey = 'link.@href';
$summaryKey = 'summary';
} elseif (Hash::get($xmlData, 'rss.@version') === '2.0') {
$items = Hash::get($xmlData, 'rss.channel.item');
$dateKey = 'pubDate';
$linkKey = 'link';
$summaryKey = 'description';
} else {
$items = Hash::get($xmlData, 'RDF.item');
$dateKey = 'dc:date';
$linkKey = 'link';
$summaryKey = 'description';
}
if (!isset($items[0]) && is_array($items)) {
$items = array($items);
}
$data = array();
foreach ($items as $item) {
$date = new DateTime($item[$dateKey]);
$summary = Hash::get($item, $summaryKey);
$data[] = array('title' => $item['title'], 'link' => Hash::get($item, $linkKey), 'summary' => $summary ? strip_tags($summary) : '', 'last_updated' => $date->format('Y-m-d H:i:s'), 'serialize_value' => serialize($item));
}
return $data;
}
开发者ID:Onasusweb,项目名称:RssReaders,代码行数:37,代码来源:RssReaderItem.php
示例17: execute
public function execute( $subpage ) {
$this->setHeaders();
$out = $this->getOutput();
$out->addHTML( Xml::openElement( 'table', array( 'class' => 'wikitable' ) ) );
$out->addHTML( '<thead>' );
$out->addHTML( '<tr>' );
$out->addHTML( '<th>' );
$out->addWikiMsg( 'userdebuginfo-key' );
$out->addHTML( '</th>' );
$out->addHTML( '<th>' );
$out->addWikiMsg( 'userdebuginfo-value' );
$out->addHTML( '</th>' );
$out->addHTML( '</tr>' );
$out->addHTML( '</thead>' );
$out->addHTML( '<tbody>' );
$this->printRow( 'userdebuginfo-useragent', htmlspecialchars( $_SERVER['HTTP_USER_AGENT'] ) );
if ( isset( $_SERVER['REMOTE_HOST'] ) ) {
$this->printRow( 'userdebuginfo-remotehost', $_SERVER['REMOTE_HOST'] );
}
$this->printRow( 'userdebuginfo-remoteaddr', wfGetIP() );
$this->printRow( 'userdebuginfo-language', htmlspecialchars( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) );
$out->addHTML( '</tbody>' );
$out->addHTML( '</table>' );
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:31,代码来源:SpecialUserDebugInfo.php
示例18: makeRedirectContent
/**
* Create a redirect that is also valid JavaScript
*
* @param Title $destination
* @param string $text ignored
* @return JavaScriptContent
*/
public function makeRedirectContent(Title $destination, $text = '')
{
// The parameters are passed as a string so the / is not url-encoded by wfArrayToCgi
$url = $destination->getFullURL('action=raw&ctype=text/javascript', false, PROTO_RELATIVE);
$class = $this->getContentClass();
return new $class('/* #REDIRECT */' . Xml::encodeJsCall('mw.loader.load', [$url]));
}
开发者ID:paladox,项目名称:mediawiki,代码行数:14,代码来源:JavaScriptContentHandler.php
示例19: WidgetCategoryCloud
function WidgetCategoryCloud($id, $params)
{
$output = "";
wfProfileIn(__METHOD__);
global $wgMemc;
$key = wfMemcKey("WidgetCategoryCloud", "data");
$data = $wgMemc->get($key);
if (is_null($data)) {
$data = WidgetCategoryCloudCloudizeData(WidgetCategoryCloudGetData());
$wgMemc->set($key, $data, 3600);
}
if (empty($data)) {
wfProfileOut(__METHOD__);
return wfMsgForContent("widget-categorycloud-empty");
}
foreach ($data as $name => $value) {
$category = Title::newFromText($name, NS_CATEGORY);
if (is_object($category)) {
$class = "cloud" . $value;
$output .= Xml::openElement("li", array("class" => $class));
// FIXME fix Wikia:link and use it here
$output .= Xml::element("a", array("class" => $class, "href" => $category->getLocalURL(), "title" => $category->getFullText()), $category->getBaseText());
$output .= Xml::closeElement("li");
$output .= "\n";
}
}
if (empty($output)) {
wfProfileOut(__METHOD__);
return wfMsgForContent("widget-categorycloud-empty");
}
$output = Xml::openElement("ul") . $output . Xml::closeElement("ul");
wfProfileOut(__METHOD__);
return $output;
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:34,代码来源:WidgetCategoryCloud.php
示例20: doTagRow
function doTagRow($tag, $hitcount)
{
$user = $this->getUser();
$newRow = '';
$newRow .= Xml::tags('td', null, Xml::element('code', null, $tag));
$disp = ChangeTags::tagDescription($tag);
if ($user->isAllowed('editinterface')) {
$disp .= ' ';
$editLink = Linker::link(Title::makeTitle(NS_MEDIAWIKI, "Tag-{$tag}"), $this->msg('tags-edit')->escaped());
$disp .= $this->msg('parentheses')->rawParams($editLink)->escaped();
}
$newRow .= Xml::tags('td', null, $disp);
$msg = $this->msg("tag-{$tag}-description");
$desc = !$msg->exists() ? '' : $msg->parse();
if ($user->isAllowed('editinterface')) {
$desc .= ' ';
$editDescLink = Linker::link(Title::makeTitle(NS_MEDIAWIKI, "Tag-{$tag}-description"), $this->msg('tags-edit')->escaped());
$desc .= $this->msg('parentheses')->rawParams($editDescLink)->escaped();
}
$newRow .= Xml::tags('td', null, $desc);
$active = isset($this->definedTags[$tag]) ? 'tags-active-yes' : 'tags-active-no';
$active = $this->msg($active)->escaped();
$newRow .= Xml::tags('td', null, $active);
$hitcountLabel = $this->msg('tags-hitcount')->numParams($hitcount)->escaped();
$hitcountLink = Linker::link(SpecialPage::getTitleFor('Recentchanges'), $hitcountLabel, array(), array('tagfilter' => $tag));
// add raw $hitcount for sorting, because tags-hitcount contains numbers and letters
$newRow .= Xml::tags('td', array('data-sort-value' => $hitcount), $hitcountLink);
return Xml::tags('tr', null, $newRow) . "\n";
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:29,代码来源:SpecialTags.php
注:本文中的Xml类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论