Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Joomla模块未获取参数_Php_Joomla - Fatal编程技术网

Php Joomla模块未获取参数

Php Joomla模块未获取参数,php,joomla,Php,Joomla,我有一个模块,我想在“标题”中加上“简短描述”。 我添加了参数,但它不起作用。我做错了什么 模块代码: <?php /** * @package SP LMS * @subpackage mod_splmscourses * * @copyright Copyright (C) 2010 - 2015 JoomShaper. All rights reserved. * @license GNU General Public License version

我有一个模块,我想在“标题”中加上“简短描述”。 我添加了参数,但它不起作用。我做错了什么

模块代码:

<?php
/**
 * @package     SP LMS
 * @subpackage  mod_splmscourses
 *
 * @copyright   Copyright (C) 2010 - 2015 JoomShaper. All rights reserved.
 * @license     GNU General Public License version 2 or later.
 */

defined('_JEXEC') or die;
jimport( 'joomla.filesystem.file' );

//Joomla Component Helper & Get LMS Params
jimport('joomla.application.component.helper');
$splmsparams = JComponentHelper::getParams('com_splms');

//Get Currency
$currency = explode(':', $splmsparams->get('currency', 'USD:$'));
$currency =  $currency[1];

// Get image thumb
$thumb_size = strtolower($splmsparams->get('course_thumbnail_small', '100X60'));


?>

<div class="mod-splms-courses <?php echo $moduleclass_sfx; ?>">

    <ul class="splms-courses-list">
        <?php foreach ($items as $item) { ?>
        <?php $item->price = ($item->price == 0) ? JText::_('MOD_SPLMS_COURSES_FREE') : JText::_($currency) . $item->price; ?>
        <?php $item->short_description; ?>
        <li class="mod-splms-course clearfix">
            <a href="<?php echo $item->url; ?>">
                <?php
                $filename = basename($item->image);
                $path = JPATH_BASE .'/'. dirname($item->image) . '/thumbs/' . JFile::stripExt($filename) . '_' . $thumb_size . '.' . JFile::getExt($filename);
                $src = JURI::base(true) . '/' . dirname($item->image) . '/thumbs/' . JFile::stripExt($filename) . '_' . $thumb_size . '.' . JFile::getExt($filename);

                if(JFile::exists($path)) {
                    $thumb = $src;
                } else {
                    $thumb = $item->image;
                }
                ?>
                <a href="<?php echo $item->url; ?>">
                    <img src="<?php echo $thumb; ?>" class="splms-course-img splms-img-responsive" alt="<?php echo $item->title; ?>">
                </a>
            </a>

            <strong class="splms-course-title">
                <a href="<?php echo $item->url; ?>" class="splms-course-title"><?php echo $item->title; ?></a>
                <p>
                    <?php echo $item->price; ?>
                    <?php echo $item->short_description; ?>
                </p>
            </strong>

        </li>
        <?php } ?>
    </ul>
</div>

<?php


如果您已经添加了short_description作为参数(在模块的xml文件中),您可以通过以下方式检索它:
$params->get('short_description','')