當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。