Joomla Extension Development 2

本文介绍如何在 Joomla 后台实现通过记录名称链接到编辑页面的功能。文章针对《JoomlaExtensionDevelopment》一书中第 41 页的内容进行了更新,并解决了因 Joomla 版本更新导致的类名变化问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

《JoomlaExtesionDevelopment》书中关于第41页,关于后台中记录,按记录名链接进行编辑的功能实现,导入joomla.filter.output,然后使用其中的JOutputFilter类。在运行时,系统提示找不到该类。查阅资料后发现,最新版本的joomla已经根据现在的命名规范将包名改为joomla.filter.filteroutpu,类名改为JFilterOutput
<?php 
function showReviews( $option, &$rows )
		{
?>
        <form action="index.php" method="post" name="adminForm">
        <table class="adminlist">
        <thead>
        <tr>
        <th width="20">
        <input type="checkbox" name="toggle"
        value="" onclick="checkAll(<?php echo
        count( $rows ); ?>);" />
        </th>
        <th class="title">Name</th>
        <th width="15%">Address</th>
        <th width="10%">Reservations</th>
        <th width="10%">Cuisine</th>
        <th width="10%">Credit Cards</th>
        <th width="5%" nowrap="nowrap">Published</th>
        </tr>
        </thead>
        <?php
		//jimport('joomla.filter.output');
		jimport('joomla.filter.filteroutput');//调整了命名规则,现改名为filteroutput
		$k = 0;
		for ($i=0, $n=count( $rows ); $i < $n; $i++)
		{
			$row = &$rows[$i];
			$checked = JHTML::_('grid.id', $i, $row->id );
			$published = JHTML::_('grid.published', $row, $i );
			$link = JFilterOutput::ampReplace( 'index.php?option=' .$option . '&task=edit&cid[]='. $row->id );
		?>
			<tr class="<?php echo "row$k"; ?>">
			<td>
			<?php echo $checked; ?>
			</td>
			<td>
            <a href="<?php echo $link; ?>">
			<?php echo $row->name; ?>
            </a>
			</td>
			<td>
			<?php echo $row->address; ?>
			</td>
			<td>
			<?php echo $row->reservations; ?>
			</td>
			<td>
			<?php echo $row->cuisine; ?>
			</td>
			<td>
			<?php echo $row->credit_cards; ?>
			</td>
			<td align="center">
			<?php echo $published;?>
			</td>
			</tr>
			<?php
			$k = 1 - $k;
		}
		?>
		</table>
		<input type="hidden" name="option"
		value="<?php echo $option;?>" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		</form>
        <?php
		}
       ?>


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值