本文整理汇总了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);
}
示例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'));
示例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);
}