當前位置: 首頁>>代碼示例>>PHP>>正文


PHP KInflector::addWord方法代碼示例

本文整理匯總了PHP中KInflector::addWord方法的典型用法代碼示例。如果您正苦於以下問題:PHP KInflector::addWord方法的具體用法?PHP KInflector::addWord怎麽用?PHP KInflector::addWord使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在KInflector的用法示例。


在下文中一共展示了KInflector::addWord方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($subject, $config = array())
 {
     $db =& JFactory::getDBO();
     if (!$db instanceof KDatabase) {
         return;
     }
     //Create the application proxy object
     $app =& JFactory::getApplication();
     if ($app instanceof KPatternProxy) {
         $app =& $app->getObject();
     }
     $app = new NookuProxyApplication($app);
     //Create the router proxy object (force load it)
     $router = $app->getRouter();
     //Create the database proxy object
     $db =& JFactory::getDBO();
     if ($db instanceof KPatternProxy) {
         $db =& $db->getObject();
     }
     $db = new NookuProxyDatabase($db);
     //Set the data in the database proxy
     $nooku = KFactory::get('admin::com.nooku.model.nooku');
     $db->setLanguages($nooku->getLanguages());
     $db->setTables($nooku->getTables());
     $db->setPrimaryLanguage($nooku->getPrimaryLanguage()->iso_code);
     //Set the language
     $nooku->setLanguage();
     //Create the language proxy object
     $lang =& JFactory::getLanguage();
     $lang = new NookuProxyLanguage($lang);
     // Add 'metadata' to inflector cache
     KInflector::addWord('metadata', 'metadata');
     // Nooku is active
     define('NOOKU', 1);
     parent::__construct($subject, $config);
 }
開發者ID:janssit,項目名稱:www.reliancelaw.be,代碼行數:36,代碼來源:nooku.php

示例2:

<?php 
// Check if Koowa is active
if (!defined('KOOWA')) {
    JError::raiseWarning(0, JText::_("Koowa wasn't found. Please install the Koowa plugin and enable it."));
    return;
}
KInflector::addWord('items', 'items');
KInflector::addWord('item', 'items');
echo KFactory::get('site::com.component.dispatcher')->dispatch(KRequest::get('get.view', 'cmd', 'items'));
開發者ID:rpijpers,項目名稱:Create,代碼行數:9,代碼來源:component.php

示例3: defined

<?php

/**
 * @package    DOCman
 * @copyright   Copyright (C) 2011 - 2013 Timble CVBA (http://www.timble.net)
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.joomlatools.com
 */
defined('_JEXEC') or die;
$words = array('event' => 'events', 'controller' => 'controllers', 'behavior' => 'behaviors', 'model' => 'models', 'table' => 'tables', 'database' => 'databases', 'command' => 'commands', 'object' => 'objects', 'adapter' => 'adapters', 'filter' => 'filters', 'view' => 'views', 'template' => 'templates', 'helper' => 'helpers', 'row' => 'rows', 'rowset' => 'rowsets', 'mixin' => 'mixins', 'parameter' => 'parameters', 'category' => 'categories', 'document' => 'documents', 'config' => 'configs', 'container' => 'containers', 'file' => 'files', 'http' => 'https', 'local' => 'locals');
foreach ($words as $singular => $plural) {
    KInflector::addWord($singular, $plural);
}
開發者ID:kosmosby,項目名稱:medicine-prof,代碼行數:13,代碼來源:init.php


注:本文中的KInflector::addWord方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。