当前位置: 首页>>代码示例>>PHP>>正文


PHP JFactory::GetApplication方法代码示例

本文整理汇总了PHP中JFactory::GetApplication方法的典型用法代码示例。如果您正苦于以下问题:PHP JFactory::GetApplication方法的具体用法?PHP JFactory::GetApplication怎么用?PHP JFactory::GetApplication使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JFactory的用法示例。


在下文中一共展示了JFactory::GetApplication方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getRuncode

    public function getRuncode(){

        //Get params
        $params = &JComponentHelper::getParams( 'com_jfoxconsole' );

        //load post and put on variables
        $jfoxcode = Jrequest::getVar('code', '', 'post','string', JREQUEST_ALLOWRAW );

        $format = JRequest::getCmd('format', 'html');

        $cols = JRequest::getInt('cols');
        $rows = JRequest::getInt('rows');

        if ($cols == 0) {
            if ($format == 'html') {
            $cols = $params->get('cols_html', 130);
            $rows = $params->get('rows_html', 20);
            } else {
            $cols = $params->get('cols_raw', 130);
            $rows = $params->get('rows_raw', 3);
           }
        }
        

        //load $app for be able to take at least live_site
        $app = JFactory::GetApplication();

        // the core that execute the code and put in one variable
        ob_start();
        eval($jfoxcode);
        $eval_result = ob_get_contents();
        ob_end_clean();

        // Way to abstract errors
        //todo: think a bit better who to do it to show another useful messages to user
        $errormessage   = 'Parse error';
        $pos = strpos($eval_result , $errormessage);

        if ($pos === false OR $params->get('filter_error') == 0) {
			if ($eval_result != ''){
					$jfoxconsoleoutput = $eval_result;
			} else {
					$jfoxconsoleoutput = JTEXT::_('COM_JFOXCONSOLE_NO_RESULT');
			}
        } else {
            $jfoxconsoleoutput = JTEXT::_('COM_JFOXCONSOLE_RUNCODE_HAS_ERROR');
        }


        $result = new stdClass;
        $result->jfoxconsoleoutput = $jfoxconsoleoutput;
        $result->jfoxcode = $jfoxcode;
        $result->cols = $cols;
        $result->rows = $rows;
        
        return $result;
    }
开发者ID:JCBR,项目名称:JFoxConsole,代码行数:57,代码来源:jfoxconsole.php

示例2: defined

<?php
/**
 * @version $Id$
 * @package    joomlafox
 * @subpackage plugin
 * @author     Webdesign Engenharia {@link http://www.webdesign.eng.br}
 * @author     Emerson da Rocha Luiz {@link http://www.fititnt.org}
 * @author     Created on 20-Oct-2009
 */

defined('_JEXEC') or die('Access Denied');

//URL
$app = JFactory::GetApplication();
//Todo: revise this part on Joomla 1.6
//$live_site = $app->isAdmin() ? $app->getSiteURL() : JURI::base();
$live_site = $app->isAdmin() ? JURI::base() : JURI::base();

$generalfox = NULL;



$generalfox .= "<div id=\"jfox_general\" style=\"display:none;\" >" .
"<fieldset><legend>What is JFox?</legend>
Version: JFox 0.7.0RC2. <br />
JFox (the new version of JoomlaFox!) is one extension for Firebug on Firefox [jfox_version.xpi], one Joomla! plugin [plg_jfox_version.tar.gz] 
and one optional component [com_jfoxconsole_version.tar.gz] that togeteder help Joomla extension developers to debug yours components, modules, plugins and templates
more easy.<br />
Oficial site: <a href=\"http://www.fititnt.org/joomlafox.html\" target=\"_blank\">http://www.fititnt.org/joomlafox.html</a><br />
Oficial forum: <a href=\"http://forum.fititnt.org/viewforum.php?f=3\" target=\"_blank\">http://forum.fititnt.org/viewforum.php?f=3</a><br />
Developer twitter: <a href=\"http://twitter.com/fititnt\" target=\"_blank\">@fititnt</a>
开发者ID:JCBR,项目名称:JFox,代码行数:31,代码来源:general.php


注:本文中的JFactory::GetApplication方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。