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


PHP sfContext::getConfiguration方法代码示例

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


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

示例1: __construct

 /**
  *
  * @param int $versionId, id of the current workflow
  * @param String $text, the text to replace
  * @param String $culture, the language
  * @param sfContext $context , context object
  */
 public function __construct($versionId, $text, $culture, $context = false) {
     if($context == false) {
         sfLoader::loadHelpers('Date');
     }
     else {
         $context->getConfiguration()->loadHelpers('Date');
     }
     $this->setWorkflow($versionId);
     $this->setWorkflowVersion($versionId);
     $this->culture = $culture;
     $this->theSender = new UserMailSettings($this->workflow['sender_id']);
     $this->newText = $this->replacePlaceholder($text);
 }
开发者ID:rlauenroth,项目名称:cuteflow_v3,代码行数:20,代码来源:ReplaceTags.php

示例2: getRouteFromItem

 /**
  * extracts the sfRoute from the item if exists
  *
  * @param array $item
  * @return mixed
  */
 protected function getRouteFromItem(&$item)
 {
     $config = $this->context->getConfiguration();
     $routing = $this->context->getRouting();
     $routeName = $item['route'];
     $routeName = self::replaceConstants($routeName);
     $item['route'] = $routeName;
     if (strpos($item['route'], '://') || strpos($item['route'], 'ww.') || strpos($item['route'], '#') !== false) {
         return false;
     } elseif (strpos($routeName, '/')) {
         $config = $routing->parse($routeName);
         return $config['_sf_route'];
     } else {
         $routeName = str_replace('@', '', $routeName);
         if (strpos($routeName, '?')) {
             $routeName = substr($routeName, 0, strpos($routeName, '?'));
         }
         $routes = $routing->getRoutes();
         return isset($routes[$routeName]) ? $routes[$routeName] : false;
     }
 }
开发者ID:vicb,项目名称:ioMenuPlugin,代码行数:27,代码来源:ioMenuConfigHandler.class.php

示例3: createInstance

 /**
  * Create a new sfSympalContext instance for a given sfContext and sfSympalConfiguration instance
  *
  * @param sfContext $symfonyContext 
  * @param sfSympalConfiguration $sympalConfiguration 
  * @return sfSympalContext $sympalContext
  */
 public static function createInstance(sfContext $symfonyContext, sfSympalConfiguration $sympalConfiguration)
 {
     $name = $symfonyContext->getConfiguration()->getApplication();
     $instance = new self($sympalConfiguration, $symfonyContext);
     self::$_instances[$name] = $instance;
     self::$_current = $instance;
     return self::$_instances[$name];
 }
开发者ID:sympal,项目名称:sympal,代码行数:15,代码来源:sfSympalContext.php

示例4: createLoader

 /**
  * Создание и предварительное конфигурирование лоадера
  *
  * @return Twig_LoaderInterface
  */
 protected function createLoader()
 {
     return new Twig_Loader_Chain([new sfTwigLoaderDirect(sfConfig::get('sf_app_dir')), new sfTwigLoaderDirect(sfConfig::get('sf_plugins_dir')), new sfTwigLoaderNamespace($this->sfContext->getConfiguration())]);
 }
开发者ID:krissym,项目名称:sfTwigPlugin,代码行数:9,代码来源:sfTwigRenderEngine.php

示例5: loadSfExtension

 /**
  * Загрузка старнадтного helper'a symfony
  */
 public function loadSfExtension()
 {
     $this->sfContext->getConfiguration()->loadHelpers(func_get_args(), $this->sfContext->getModuleName());
 }
开发者ID:krissym,项目名称:sfTwigPlugin,代码行数:7,代码来源:sfHelperTwigExtension.class.php

示例6: checkConfiguration

 /**
  * Checks that the current project context is suitable to use sfDynamics.
  *
  * @return void
  */
 public static function checkConfiguration(sfContext $context)
 {
     if ($context->getConfiguration() instanceof sfApplicationConfiguration) {
         $enabledModules = sfConfig::get('sf_enabled_modules');
         if (!in_array('sfDynamics', $enabledModules)) {
             throw new sfDynamicsConfigurationException("sfDynamics module is not enabled in current application.\n\nTo be able to load an sfDynamicsManager instance (which is required to load a sfDynamics package), you must enable it under the enabled_modules list in your application's settings.yml.");
         }
     }
 }
开发者ID:hartym,项目名称:sfdynamicsplugin,代码行数:14,代码来源:sfDynamics.class.php

示例7: doGeneratePdf

 protected function doGeneratePdf(sfContext $context, $chartBuilder, $file)
 {
     // definition of chart builder class
     $this->setChartBuilder($chartBuilder);
     // creation of a context
     $context->getConfiguration()->loadHelpers('Partial');
     $context->getRequest()->setRequestFormat('html');
     $config = sfTCPDFPluginConfigHandler::loadConfig();
     sfTCPDFPluginConfigHandler::includeLangFile($context->getUser()->getCulture());
     $doc_title = $this->getName() . " Report";
     $doc_subject = $this->getName() . " Report generated by Otokou";
     $doc_keywords = "report, otokou";
     //create new PDF document (document units are set by default to millimeters)
     $pdf = new sfTCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor(PDF_AUTHOR);
     $pdf->SetTitle($doc_title);
     $pdf->SetSubject($doc_subject);
     $pdf->SetKeywords($doc_keywords);
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
     //set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     //set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     //set image scale factor
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     //initialize document
     $pdf->AliasNbPages();
     // report informations
     $pdf->AddPage();
     $html = get_partial('report/general_info', array('report' => $this));
     $pdf->writeHTML($html, true, false, true, false, '');
     // vehicles overall performances
     $html = '<h1>Vehicles performances</h1>' . '<p>The values presented below are calculated overall the entire life period of the vehicle(s).</p>' . get_partial('report/vehicles_performances', array('vehicles' => $this->getVehicles()));
     $pdf->writeHTML($html, true, false, true, false, '');
     // charts
     $pdf->AddPage();
     $html = '<h1>Costs</h1>';
     $pdf->writeHTML($html, true, false, true, false, '');
     $counter = 0;
     $options = array();
     $attributes = array('absolute' => true);
     $charts = $this->defineCharts($options, $attributes);
     $nc = count($charts);
     foreach ($charts as $c) {
         $counter++;
         //$html = get_partial('report/chart', array('chart' => $c));
         //$pdf->writeHTML($html, true, false, true, false, '');
         $html = '<h2>' . $c['title'] . '</h2><p>' . $c['comment'] . '</p>';
         $pdf->writeHTML($html);
         $c['chart']->generate();
         $pdf->Image($c['chart']->getChartFileSystemPath());
         if ($counter < $nc) {
             $pdf->AddPage();
         }
     }
     // Close and output PDF document
     $pdf->Output($file, 'F');
 }
开发者ID:rbolliger,项目名称:otokou,代码行数:64,代码来源:Report.class.php


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