本文整理汇总了PHP中object::get方法的典型用法代码示例。如果您正苦于以下问题:PHP object::get方法的具体用法?PHP object::get怎么用?PHP object::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToolBar
/**
* Устанавливает панель инструментов.
*
* @return void
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_HELLOWORLD_MANAGER_HELLOWORLDS'), 'helloworld');
if ($this->canDo->get('core.create')) {
JToolBarHelper::addNew('helloworld.add');
}
if ($this->canDo->get('core.edit')) {
JToolBarHelper::editList('helloworld.edit');
}
if ($this->canDo->get('core.edit.state')) {
JToolBarHelper::divider();
JToolbarHelper::publish('helloworlds.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('helloworlds.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolBarHelper::divider();
JToolBarHelper::archiveList('helloworlds.archive');
}
if ($this->state->get('filter.state') == -2 && $this->canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'helloworlds.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($this->canDo->get('core.edit.state')) {
JToolBarHelper::trash('helloworlds.trash');
}
if ($this->canDo->get('core.admin')) {
JToolBarHelper::divider();
JToolBarHelper::preferences('com_helloworld');
}
}
示例2: testGetInvalid
/**
* testGetInvalid
*
* @since 2.1.0
*/
public function testGetInvalid()
{
/* result */
$result = $this->_registry->get('invalidKey');
/* compare */
$this->assertEquals(null, $result);
}
示例3: getPage
/**
* Get the requested Page.
*
* @access public
*/
public function getPage()
{
$_GET['act'] = empty($_GET['act']) ? '' : $_GET['act'];
switch ($_GET['act']) {
case 'lostpw':
$this->showPasswordLost();
break;
case 'resetpw':
$this->showPasswordReset();
break;
case 'verify':
$this->verifyUserAccount();
break;
case 'captcha':
$this->getCaptcha();
break;
default:
$this->showLogin();
break;
}
$this->objTemplate->setVariable('CONTREXX_CHARSET', CONTREXX_CHARSET);
$endcode = $this->objTemplate->get();
// replace links from before contrexx 3
$cx = \Cx\Core\Core\Controller\Cx::instanciate();
$ls = new \LinkSanitizer($cx, $cx->getCodeBaseOffsetPath() . $cx->getBackendFolderName() . '/', $endcode);
$endcode = $ls->replace();
echo $endcode;
exit;
}
示例4: getCustomFormEntryFilesDetailedMainViewRow
/**
* Displays a EasyContactFormsCustomFormEntryFiles detailedMain view
* record
*
* @param object $view
* the EasyContactFormsCustomFormEntryFiles detailedMain view object
* @param object $obj
* a db object
* @param int $i
* record index
* @param array $map
* request data
*/
function getCustomFormEntryFilesDetailedMainViewRow($view, $obj, $i, $map)
{
$obj->File = array('doctype' => 'CustomFormEntryFiles', 'docid' => $obj->get('id'), 'field' => 'File', 'tag' => 'a', 'content' => EasyContactFormsT::get('Download'));
?>
<tr class='ufohighlight <?php
EasyContactFormsIHTML::getTrSwapClassName($i);
?>
'>
<td class='firstcolumn'>
<input type='checkbox' id='<?php
echo $view->idJoin('cb', $obj->getId());
?>
' value='off' class='ufo-deletecb' onchange='this.value=(this.checked)?"on":"off";'/>
</td>
<td>
<?php
echo $obj->get('id');
?>
</td>
<td>
<?php
echo $obj->get('Description');
?>
</td>
<td>
<?php
EasyContactFormsIHTML::getFileDownloadLink($obj->File);
?>
</td>
</tr>
<?php
}
开发者ID:87surendra,项目名称:mbr,代码行数:45,代码来源:easy-contact-forms-customformentryfilesdetailedmainviewrow.php
示例5: login
/**
* login() method return succeeded HTML message of connector
*
* @param $sData
* @return string
*/
protected function login($sData = '')
{
$sLink = '';
// get back URI
$sBackURI = self::$oSession->get('back');
if (!empty($sBackURI)) {
$sLink = urldecode($sBackURI);
} else {
if (version_compare(_PS_VERSION_, '1.4', '>')) {
$sLink = BT_FPCModuleTools::getAccountPageLink();
} else {
global $smarty;
$sLink = $smarty->_tpl_vars['base_dir_ssl'] . 'my-account.php';
}
}
if (!empty($sData)) {
$sLink .= (strstr($sLink, '?') ? '&' : '?') . 'data=' . $sData;
}
// detect user agent to redirect or close the popup windows and reload the current page
if (!empty($_SERVER['HTTP_USER_AGENT']) && (stristr($_SERVER['HTTP_USER_AGENT'], 'iphone') || stristr($_SERVER['HTTP_USER_AGENT'], 'mobile'))) {
header("Location: " . $sLink);
exit(0);
} else {
return '<script>' . ' window.opener.location.href = "' . $sLink . '";' . ' window.opener.focus();' . ' window.close();' . '</script>';
}
}
示例6: preflight
/**
* Method to run before an install/update/uninstall method
*
* @param string $type is the type of change (install, update or discover_install)
* @param object $parent is the class calling this method
*
* @return boolean false if error occurs
*/
function preflight($type, $parent)
{
$app = JFactory::getApplication();
$jversion = new JVersion();
$jInstall = new JInstaller('mod_bwpostman_overview');
// Get component manifest file version
$this->release = $parent->get("manifest")->version;
// Manifest file minimum Joomla version
$this->minimum_joomla_release = $parent->get("manifest")->attributes()->version;
// abort if the current Joomla release is older
if (version_compare($jversion->getShortVersion(), $this->minimum_joomla_release, 'lt')) {
$app->enqueueMessage(JText::sprintf('MOD_BWPOSTMAN_OVERVIEW_INSTALL_ERROR_JVERSION', $this->minimum_joomla_release), 'error');
return false;
}
if (floatval(phpversion()) < 5) {
$app->enqueueMessage(JText::_('MOD_BWPOSTMAN_OVERVIEW_USES_PHP5'), 'error');
return false;
}
// abort if the component being installed is not newer than the currently installed version
if ($type == 'update') {
$oldRelease = $this->getManifestVar('version');
$app->setUserState('mod_bwpostman_overview.update.oldRelease', $oldRelease);
if (version_compare($this->release, $oldRelease, 'lt')) {
$app->enqueueMessage(JText::sprintf('MOD_BWPOSTMAN_OVERVIEW_INSTALL_ERROR_INCORRECT_VERSION_SEQUENCE', $oldRelease, $this->release), 'error');
return false;
}
}
return true;
}
示例7: getThumbnail
/**
* when in form or detailed view, do we want to show the full image or thumbnail/link?
* @param object $params
* @return bool
*/
private function getThumbnail(&$model, &$params, $file)
{
if ($this->inTableView || $params->get('make_thumbnail') == '1' && $params->get('fu_show_image') == 1) {
if (!$params->get('make_thumbnail', false)) {
return false;
} else {
$thumb_url = $model->getStorage()->_getThumb($file);
$thumb_file = $model->getStorage()->urlToPath($thumb_url);
$thumb_url_info = pathinfo($thumb_url);
if (JString::strtolower($thumb_url_info['extension'] == 'pdf')) {
$thumb_url = $thumb_url_info['dirname'] . '/' . $thumb_url_info['filename'] . '.' . $this->pdf_thumb_type;
$thumb_file_info = pathinfo($thumb_file);
$thumb_file = $thumb_file_info['dirname'] . '/' . $thumb_file_info['filename'] . '.' . $this->pdf_thumb_type;
}
if ($model->getStorage()->exists($thumb_file)) {
return $thumb_url;
} else {
$thumb_file = COM_FABRIK_BASE . 'media/com_fabrik/images/pdf.png';
if (JFile::exists($thumb_file)) {
return $thumb_file;
} else {
return false;
}
}
}
}
return false;
}
示例8: getPage
/**
* Get the requested Page.
*
* @access public
*/
public function getPage()
{
$_GET['act'] = empty($_GET['act']) ? '' : $_GET['act'];
switch ($_GET['act']) {
case 'lostpw':
$this->showPasswordLost();
break;
case 'resetpw':
$this->showPasswordReset();
break;
case 'verify':
$this->verifyUserAccount();
break;
case 'captcha':
$this->getCaptcha();
break;
default:
$this->showLogin();
break;
}
$this->objTemplate->setVariable('CONTREXX_CHARSET', CONTREXX_CHARSET);
$endcode = $this->objTemplate->get();
// replace links from before contrexx 3
$ls = new \LinkSanitizer(ASCMS_PATH_OFFSET . ASCMS_BACKEND_PATH . '/', $endcode);
$endcode = $ls->replace();
echo $endcode;
exit;
}
示例9: display
/**
* Displays the view
*
* @param string $tpl The name of the template file to parse
*
* @return void
*
* @since 2.5
*/
public function display($tpl = null)
{
$doc = JFactory::getDocument();
$doc->addStyleSheet(JURI::root() . 'media/overrider/css/overrider.css');
JHtml::_('behavior.framework');
$doc->addScript(JURI::root() . 'media/overrider/js/overrider.js');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
// Check for errors
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors));
return;
}
// Check whether the cache has to be refreshed
$cached_time = JFactory::getApplication()->getUserState('com_languages.overrides.cachedtime.' . $this->state->get('filter.client') . '.' . $this->state->get('filter.language'), 0);
if (time() - $cached_time > 60 * 5) {
$this->state->set('cache_expired', true);
}
// Add strings for translations in Javascript
JText::script('COM_LANGUAGES_VIEW_OVERRIDE_NO_RESULTS');
JText::script('COM_LANGUAGES_VIEW_OVERRIDE_REQUEST_ERROR');
$this->addToolbar();
parent::display($tpl);
}
示例10: concat
/**
* concat the collection
*
* @since 3.0.0
*
* @param array $optionArray
* @param array $rewriteArray
*
* @return Loader
*/
public function concat($optionArray = [], $rewriteArray = [])
{
$bundleArray = [];
$restArray = [];
/* prevent as needed */
if ($this->_registry->get('noCache')) {
return $this;
}
/* process collection */
foreach ($this->_collectionArray as $collectionKey => $attributeArray) {
$path = $attributeArray[$optionArray['attribute']];
$fileArray = pathinfo($path);
if (is_file($path) && $fileArray['extension'] === $optionArray['extension']) {
$bundleArray[] = $attributeArray[$optionArray['attribute']];
} else {
$restArray[] = $attributeArray;
}
}
/* cache as needed */
$cache = new Cache();
$cache->init($optionArray['directory'], $optionArray['extension']);
/* load from cache */
if ($cache->validate($bundleArray, $optionArray['lifetime'])) {
$this->_collectionArray = $restArray;
$this->_collectionArray['bundle'] = [$optionArray['attribute'] => $cache->getPath($bundleArray)];
if ($optionArray['extension'] === 'css') {
$this->_collectionArray['bundle']['rel'] = 'stylesheet';
}
} else {
$content = $this->_getContent($bundleArray, $rewriteArray);
$cache->store($bundleArray, $content);
}
return $this;
}
示例11: formatFormErrors
/**
* Extract form errors from the API and allocate errors to the form itself
* @param object $objForm
* @param object $request
* @return Form $object
*/
public function formatFormErrors($objForm, $request)
{
if ($request instanceof \Exception) {
//extract message from exception
$request = $request->getMessage();
}
//end if
//extract errors from the request return by the API
$arr_response = explode("||", $request);
$objResponse = json_decode(trim($arr_response[1]));
if (!is_object($objResponse)) {
//errors could not be extracted, append message to first element
foreach ($objForm->getElements() as $objElement) {
$objForm->get($objElement->getName())->setMessages(array("An unknown error has occured. Form errors could not be loaded"));
}
//end foreach
} else {
foreach ($objResponse->data as $objField) {
if (!isset($objField->messages)) {
continue;
}
//end if
if (count($objField->messages) > 0) {
$objForm->get($objField->attributes->name)->setMessages((array) $objField->messages);
}
//end if
}
//end foreach
}
//end if
return $objForm;
}
示例12: getPage
/**
* Get content page
*
* @access public
*/
function getPage()
{
if (isset($_GET['cmd'])) {
$action = $_GET['cmd'];
} elseif (isset($_GET['act'])) {
$action = $_GET['act'];
} else {
$action = '';
}
switch ($action) {
case 'surveypreview':
$this->SurveyPreview();
break;
case 'surveyattend':
$this->SurveyAttend();
break;
case 'questionpreview':
$this->QuestionPreview();
break;
case 'homesurvey':
$this->surveyOverview();
break;
case 'activesurveys':
$this->activeSurveys();
break;
case 'surveybyId':
$this->surveyById();
break;
default:
$this->surveyOverview();
break;
}
return $this->_objTpl->get();
}
示例13: onBeforeStore
/**
* process the plugin, called when form is submitted
*
* @param object $params
* @param object form
*/
function onBeforeStore( &$params, &$formModel )
{
global $vbulletin;
define(VB_AREA, 'fabrik');
define(THIS_SCRIPT, 'fabrik');
// Initialize some variables
$db = FabrikWorker::getDbo();
$data = $formModel->_formData;
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
$elementModel = $formModel->getPluginManager()->getElementPlugin($params->get('vb_forum_field'));
$element = $elementModel->getElement(true);
$this->map_forum_field = $elementModel->getFullName();
$this->vb_parent_forum = $params->get('vb_parent', '');
$method = "POST";
$url = JURI::base(). "forum/mkforum.php";
$vars = array();
$vars['forum_name'] = $data[$this->map_forum_field];
$vars['forum_parent'] = $this->vb_parent_forum;
$res = $this->doRequest($method, $url, $vars);
}
示例14: item
/**
* Retrieve a property from the internal item object
*
* @param string $key Property to retrieve
* @param mixed $default
* @return string
*/
public function item($key = '', $default = null)
{
if ($key && is_object($this->_item)) {
return $this->_item->get($key, $default);
}
return $this->_item;
}
示例15: getAnnotations
/**
* Get the annotations.
*
* @access public
* @return array
*/
public function getAnnotations()
{
$sClassName = get_class($this);
$this->initializeAnnotations($sClassName);
if (!($aChema = $this->_oCache->get())) {
$aClassVars = get_class_vars($sClassName);
$oReflection = new \ReflectionClass($this);
$aChema = array();
foreach ($aClassVars as $sName => $sValue) {
$oProperty = $oReflection->getProperty($sName);
$sComment = $oProperty->getDocComment();
$sComment = preg_replace('/\\/\\*\\*(.*)\\*\\//', '$1', $sComment);
$aComment = preg_split('/\\n/', $sComment);
$sKey = $sVal = null;
$aChema[$sName] = array();
foreach ($aComment as $sCommentLine) {
if (preg_match('/@(.*?): (.*)/i', $sCommentLine, $aMatches)) {
$sKey = $aMatches[1];
$sKey = $aMatches[2];
$aChema[$sName][trim($sKey)] = trim($sVal);
}
}
}
unset($oReflection);
$this->saveAnnotations($aChema);
}
return $aChema;
}