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


PHP KObject::get方法代码示例

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


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

示例1: getLink

 public function getLink($options = array())
 {
     $option = $this->_options['option'];
     $view = KRequest::get('get.view', 'cmd');
     // modify url
     $url = clone KRequest::url();
     $query = new KObject();
     $query->set($url->getquery(1));
     //$query['view']	= 'settings';
     $query->order = null;
     $query->direction = null;
     $query->limit = null;
     $query->offset = null;
     if (isset($query->tmpl)) {
         JTML::_('behavior.modal');
     }
     $this->modal = true;
     //$query['layout']= 'default';
     $query->set($options);
     $url->setQuery($query->get());
     return $url;
 }
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:22,代码来源:link.php

示例2: var_dump

var_dump('Nested folder', $result);
/*
 * Root files
 */
$result = KObject::get('com:files.controller.file')->container('files-files')->limit(5)->browse()->toArray();
var_dump('Root files', $result);
/*
 * Nested files
 */
$result = KObject::get('com:files.controller.file')->container('files-files')->folder('stories')->limit(5)->browse()->toArray();
var_dump('Nested files', $result);
/*
 * Root folders
 */
$result = KObject::get('com:files.controller.folder')->container('files-files')->limit(5)->browse()->toArray();
var_dump('Root folders', $result);
/*
 * Nested folders
 */
$result = KObject::get('com:files.controller.folder')->container('files-files')->folder('stories')->limit(5)->browse()->toArray();
var_dump('Nested folders', $result);
/*
 * Root nodes
 */
$result = KObject::get('com:files.controller.node')->container('files-files')->limit(5)->browse()->toArray();
var_dump('Root nodes', $result);
/*
 * Nested nodes
 */
$result = KObject::get('com:files.controller.node')->container('files-files')->folder('stories')->limit(5)->browse()->toArray();
var_dump('Nested nodes', $result);
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:31,代码来源:tests_get.php

示例3: var_dump

var_dump('Root file - move', $result, !file_exists(JPATH_ROOT . '/images/random_test_file.txt') && file_exists(JPATH_ROOT . '/images/moved_test_file.txt'));
/*
 * Root file - copy
 */
$result = KObject::get('com:files.controller.file')->container('files-files')->name('moved_test_file.txt')->copy(array('destination_name' => 'copied_test_file.txt'))->toArray();
var_dump('Root file - copy', $result, file_exists(JPATH_ROOT . '/images/moved_test_file.txt') && file_exists(JPATH_ROOT . '/images/copied_test_file.txt'));
/*
 * Nested file - move
 */
$result = KObject::get('com:files.controller.file')->container('files-files')->name('moved_test_file.txt')->move(array('destination_folder' => 'random_test_folder'))->toArray();
var_dump('Nested file - move', $result, !file_exists(JPATH_ROOT . '/images/moved_test_file.txt') && file_exists(JPATH_ROOT . '/images/random_test_folder/moved_test_file.txt'));
/*
 * Nested file - copy
 */
$result = KObject::get('com:files.controller.file')->container('files-files')->name('copied_test_file.txt')->copy(array('destination_folder' => 'random_test_folder'))->toArray();
var_dump('Nested file - copy', $result, file_exists(JPATH_ROOT . '/images/copied_test_file.txt') && file_exists(JPATH_ROOT . '/images/random_test_folder/copied_test_file.txt'));
/*
 * Nested file - copy with a new name
 */
$result = KObject::get('com:files.controller.file')->container('files-files')->name('copied_test_file.txt')->copy(array('destination_folder' => 'random_test_folder', 'destination_name' => 'copied_test_file2.txt'))->toArray();
var_dump('Nested file - copy with a new name', $result, file_exists(JPATH_ROOT . '/images/copied_test_file.txt') && file_exists(JPATH_ROOT . '/images/random_test_folder/copied_test_file2.txt'));
/*
 * Nested file - move with a new name
 */
$result = KObject::get('com:files.controller.file')->container('files-files')->name('copied_test_file.txt')->move(array('destination_folder' => 'random_test_folder', 'destination_name' => 'moved_test_file2.txt'))->toArray();
var_dump('Nested file - move with a new name', $result, !file_exists(JPATH_ROOT . '/images/copied_test_file.txt') && file_exists(JPATH_ROOT . '/images/random_test_folder/moved_test_file2.txt'));
/*
 * Delete test files
 */
$result = KObject::get('com:files.controller.folder')->container('files-files')->name('random_test_folder')->delete()->toArray();
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:30,代码来源:tests_movecopy.php

示例4: var_dump

var_dump('Root file - delete', $result, !file_exists(JPATH_ROOT . '/images/ercan.txt'));
/*
 * Nested file - add
 */
$result = KObject::get('com:files.controller.file')->container('files-files')->folder('banners')->name('nested.txt')->add(array('contents' => 'test'))->toArray();
var_dump('Nested file - add', $result, file_exists(JPATH_ROOT . '/images/banners/nested.txt'));
/*
 * Nested file - delete
 */
$result = KObject::get('com:files.controller.file')->container('files-files')->folder('banners')->name('nested.txt')->delete()->toArray();
var_dump('Nested file - delete', $result, !file_exists(JPATH_ROOT . '/images/banners/nested.txt'));
/*
 * Root folder - add
 */
$result = KObject::get('com:files.controller.folder')->container('files-files')->name('ercan_test')->add()->toArray();
var_dump('Root folder - add', $result, is_dir(JPATH_ROOT . '/images/ercan_test'));
/*
 * Root folder - delete
 */
$result = KObject::get('com:files.controller.folder')->container('files-files')->name('ercan_test')->delete()->toArray();
var_dump('Root folder - delete', $result, !file_exists(JPATH_ROOT . '/images/ercan_test'));
/*
 * Nested folder - add
 */
$result = KObject::get('com:files.controller.folder')->container('files-files')->folder('banners')->name('ercan_nested')->add()->toArray();
var_dump('Nested folder - add', $result, is_dir(JPATH_ROOT . '/images/banners/ercan_nested'));
/*
 * Nested folder - delete
 */
$result = KObject::get('com:files.controller.folder')->container('files-files')->folder('banners')->name('ercan_nested')->delete()->toArray();
var_dump('Nested folder - delete', $result, !file_exists(JPATH_ROOT . '/images/banners/nested.txt'));
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:31,代码来源:tests_post.php

示例5: get

 /**
  * Get the raw value of a property or return the default value passed
  * 
  * @param  string $name    Then name of the property
  * @param  mixed  $default The default value
  * 
  * @return mixed
  */
 public function get($name = null, $default = null)
 {
     $description = $this->getEntityDescription();
     //get the property
     $property = $description->getProperty($name);
     if (!$property) {
         return parent::get($name, $default);
     }
     //get the property name
     $name = $property->getName();
     $value = $this->_data->offsetGet($name);
     if ($property->isRelationship() && $property->isOneToMany() && is_null($value)) {
         //since it's an external relationship
         //lets instantitate a dummy relationship
         //this should happen for the one-to-one relationships
         if ($property->isOneToOne()) {
             return null;
         }
         $value = $this->_data[$name] = $property->getSet($this);
         return $value;
     }
     return is_null($value) ? $default : $value;
 }
开发者ID:walteraries,项目名称:anahita,代码行数:31,代码来源:abstract.php

示例6: render

 public function render()
 {
     return $this->_parent->getTemplate()->loadIdentifier('button_default', array('name' => $this->getName(), 'text' => $this->getText(), 'id' => $this->getId(), 'attribs' => $this->attribs->get()))->render(true);
 }
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:4,代码来源:abstract.php

示例7: _createButton

 protected function _createButton($url, $name, $button)
 {
     $html = array();
     $var = KInflector::underscore($button);
     $href = new KObject();
     $href->set(array_merge($url->get(), array('view' => $var)));
     $attr = current((array) $button->attributes());
     if ($attr['view'] == KRequest::get('get.view', 'cmd', 'dashboard')) {
         return false;
     }
     $img = isset($attr['img']) ? $attr['img'] : null;
     $attr['img'] = null;
     if (!empty($attr)) {
         $href->set($attr);
     }
     $html[] = '<div><div class="dashboard-button">';
     $html[] = '<a href="' . JRoute::_('index.php?' . http_build_query($href->get())) . '"><img src="' . KFactory::get('admin::com.ninja.helper.default')->img('/48/' . JFile::stripExt(basename($img)) . '.png') . '" alt="' . $button . '"/><span>' . JText::_($button) . '</span></a>';
     $html[] = '</div></div>';
     return implode($html);
 }
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:20,代码来源:manifest.php


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