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


PHP Fox::getModel方法代码示例

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


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

示例1: _prepareForm

 /**
  * Prepare form
  * 
  * @param Uni_Core_Form $form 
  */
 protected function _prepareForm(Uni_Core_Form $form)
 {
     $form->setName('menu')->setMethod('post');
     $subForm1 = new Zend_Form_SubForm();
     $subForm1->setLegend('Menu Item Information');
     $subForm1->setDescription('Menu Item Information');
     $idField = new Zend_Form_Element_Hidden('id');
     $title = new Zend_Form_Element_Text('title', array('class' => 'required', 'maxlength' => 200));
     $title->setRequired(true)->setLabel('Title')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $link = new Zend_Form_Element_Text('link', array('maxlength' => 200));
     $link->setLabel('Link')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDescription('Use module/controller/action for internal links or http://www.example.com for external links');
     $open_window = new Zend_Form_Element_Select('open_window', array('class' => 'required', 'maxlength' => 200));
     $open_window->setRequired(true)->setLabel('Open Window')->setMultiOptions(Fox::getModel('navigation/menu')->getAllTargetWindows());
     $status = new Zend_Form_Element_Select('status', array('class' => 'required', 'maxlength' => 200));
     $status->setRequired(true)->setLabel('Status')->setMultiOptions(Fox::getModel('navigation/menu')->getAllStatuses());
     $sort_order = new Zend_Form_Element_Text('sort_order', array('class' => 'required', 'maxlength' => 200));
     $sort_order->setRequired(true)->setLabel('Sort Order')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $style_class = new Zend_Form_Element_Text('style_class');
     $style_class->setLabel('Style Class')->addFilter('StripTags')->addFilter('StringTrim');
     $menugroup = new Zend_Form_Element_Multiselect('menu_group', array('class' => 'required'));
     $menugroup->setRequired(true)->setLabel('Menu Group')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setMultiOptions(Fox::getModel('navigation/menugroup')->getMenuGroupOptions());
     $subForm1->addElements(array($idField, $title, $link, $open_window, $sort_order, $style_class, $status, $menugroup));
     $form->addSubForm($subForm1, 'subform1');
     parent::_prepareForm($form);
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:30,代码来源:Form.php

示例2: reply

 /**
  * Send reply to contact request
  * 
  * @param string $replyMessage 
  */
 public function reply($replyMessage)
 {
     $this->setStatus(Fox_Contact_Model_Contact::STATUS_REPLIED);
     $this->save();
     $modelTemplate = Fox::getModel('core/email/template');
     $modelTemplate->sendTemplateMail(Fox::getPreference('contact/reply/email_template'), $this->getEmail(), array('sender_email' => Fox::getPreference('contact/reply/email'), 'sender_name' => Fox::getPreference('contact/reply/name')), array('name' => $this->getName(), 'subject' => $this->getSubject(), 'message' => $this->getMessage(), 'reply' => $replyMessage));
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:12,代码来源:Contact.php

示例3: getTemplateContent

 /**
  * Get newsletter template content
  * 
  * @return string
  */
 public function getTemplateContent()
 {
     $id = $this->getRequest()->getParam('tId');
     $model = Fox::getModel('newsletter/template');
     $model->load($id);
     return $model->getContent();
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:12,代码来源:Preview.php

示例4: getAllGeneratedPackages

 /**
  * Get all generated packages
  * 
  * @return array
  */
 public function getAllGeneratedPackages()
 {
     $package = Fox::getModel("extensionmanager/generate/package");
     $pkgPath = $package->getGeneratedPkgDir();
     $pkgList = array();
     $noMod = array('.', '..');
     $doc = new DOMDocument();
     if (is_dir($pkgPath)) {
         $dp = opendir($pkgPath);
         while ($file = readdir($dp)) {
             if (!in_array($file, $noMod)) {
                 $doc->load($pkgPath . DS . $file);
                 if ($doc->documentElement->nodeName == Fox_Extensionmanager_Model_Generate_Package::PACKAGE_ROOT_ELEMENT && $doc->documentElement->childNodes) {
                     $data = array();
                     $nList = $doc->documentElement->childNodes;
                     foreach ($nList as $n) {
                         if (in_array($n->nodeName, array(Fox_Extensionmanager_Model_Generate_Package::PACKAGE_NAME_ELEMENT, Fox_Extensionmanager_Model_Generate_Package::PACKAGE_VERSION_ELEMENT, Fox_Extensionmanager_Model_Generate_Package::PACKAGE_STABILITY_ELEMENT))) {
                             $data[$n->nodeName] = $n->nodeValue;
                         }
                     }
                     if ($data) {
                         $pkgList[] = $data;
                     }
                 }
             }
         }
     }
     sort($pkgList);
     return $pkgList;
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:35,代码来源:Table.php

示例5: getConfig

 /**
  * Get config
  * 
  * @return Fox_Extensionmanager_Model_Config 
  */
 protected function getConfig()
 {
     if (!$this->config) {
         $this->config = Fox::getModel("extensionmanager/config");
     }
     return $this->config;
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:12,代码来源:Packages.php

示例6: routKey

 /**
  * Loades cms page of specified key
  *
  * @param Fox_Core_Controller_Action $controller
  * @param string $key
  * @return boolean 
  */
 public function routKey($controller, $key)
 {
     $page = Fox::getModel('cms/page');
     $page->load($key, 'url_key');
     if ($page->getId() && $page->getStatus()) {
         if (($container = $page->getLayout()) != '') {
             $layoutUpdate = '<container key="' . $container . '"/>';
         }
         if (($lUpdate = $page->getLayoutUpdate()) != '') {
             $layoutUpdate .= $lUpdate;
         }
         $layout = $controller->loadLayout($layoutUpdate, $key);
         $layout->setTitle($page->getTitle());
         $layout->setMetaKeywords($page->getMetaKeywords());
         $layout->setMetaDescription($page->getMetaDescription());
         if ($contentView = $controller->getViewByKey('content')) {
             $pageView = Fox::getView('cms/page');
             $pageView->setPageContent($page->getContent());
             $pageView->setPageTitle($page->getTitle());
             $pageView->setPageUrlKey($page->getUrlKey());
             $contentView->addChild('__page_content__', $pageView);
         }
         $controller->renderLayout();
         $controller->getResponse()->setHeader('HTTP/1.1', '200 ok');
         $controller->getResponse()->setHeader('Status', '200 ok');
         $this->routingCompleted = TRUE;
     }
     return $this->routingCompleted;
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:36,代码来源:Router.php

示例7: deleteModules

 /**
  * Delete Modules
  * 
  * @param array $modules Name of modules that needs to be deleted are passed as array values
  */
 public function deleteModules($modules)
 {
     foreach ($modules as $moduleName) {
         $module = Fox::getModel('core/module');
         $module->load($moduleName);
         $module->delete();
     }
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:13,代码来源:Module.php

示例8: getCurrentMember

 /**
  * Get current logined member
  * 
  * @return Fox_Member_Model_Member|NULL
  */
 public function getCurrentMember()
 {
     if (is_null($this->currentMember)) {
         $session = Fox::getModel('member/session');
         $this->currentMember = $session->getLoginData();
     }
     return $this->currentMember;
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:13,代码来源:Member.php

示例9: _prepareColumns

 /**
  * Prepare table columns
  */
 protected function _prepareColumns()
 {
     $this->addColumn('id', array('label' => 'Id', 'align' => 'left', 'type' => self::TYPE_NUMBER, 'width' => 50, 'field' => 'id'));
     $this->addColumn('name', array('label' => 'Name', 'align' => 'left', 'field' => 'name'));
     $this->addColumn('email', array('label' => 'Email', 'align' => 'left', 'field' => 'email'));
     $this->addColumn('status', array('label' => 'Status', 'align' => 'center', 'width' => 150, 'type' => self::TYPE_OPTIONS, 'options' => Fox::getModel('newsletter/subscriber')->getAllStatuses(), 'field' => 'status'));
     parent::_prepareColumns();
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:11,代码来源:Table.php

示例10: _prepareForm

 /**
  * Prepare form
  * 
  * @param Uni_Core_Form_Eav $form 
  */
 protected function _prepareForm(Uni_Core_Form_Eav $form)
 {
     $form->setName('setting')->setMethod('post');
     $model = Fox::getModel($this->getModelKey());
     $eavMetaData = $model->getEavFormMetaData();
     $form->createEavForm($eavMetaData);
     $form->setElementsBelongTo($model->getItem());
     parent::_prepareForm($form);
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:14,代码来源:Form.php

示例11: _prepareCollection

 /**
  * Prepare model collection
  */
 protected function _prepareCollection()
 {
     $model = Fox::getModel('core/email/template');
     $sortCondition = $this->getSortCondition();
     $filters = $this->getSearchCriteria();
     $collection = $model->getModelCollection($filters, '*', $sortCondition, $this->getColumns());
     $this->setCollection($collection);
     parent::_prepareCollection();
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:12,代码来源:Table.php

示例12: _prepareCollection

 /**
  * Prepare model collection
  */
 protected function _prepareCollection()
 {
     $sortCondition = $this->getSortCondition();
     $filters = $this->getSearchCriteria();
     $setModel = Fox::getModel('eav/set');
     $collection = $setModel->getModelCollection($filters, '*', $sortCondition, $this->getColumns());
     $this->setCollection($collection);
     parent::_prepareCollection();
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:12,代码来源:Table.php

示例13: getBlockContent

 /**
  * Get parsed cms block content
  *
  * @param string $identifierKey
  * @return string 
  */
 public function getBlockContent($identifierKey)
 {
     $parsedContent = NULL;
     $model = Fox::getModel('cms/block');
     $model->load($identifierKey, 'identifier_key');
     if ($model->getId() && $model->getStatus() == Fox_Cms_Model_Block::STATUS_ENABLED) {
         $parsedContent = $this->view->getParsedContent($model->getContent());
     }
     return $parsedContent;
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:16,代码来源:GetBlockContent.php

示例14: _prepareForm

 /**
  * Prepare form
  * 
  * @param Uni_Core_Form_Eav $form 
  */
 protected function _prepareForm(Uni_Core_Form_Eav $form)
 {
     $form->setName('member')->setMethod('post');
     $model = Fox::getModel($this->getModelKey());
     $eavMetaData = $model->getEavFormMetaData(1);
     $form->createEavForm($eavMetaData);
     $form->addPrefixPath('Uni_Core_Admin_View_Form_Decorator', 'Uni/Core/Admin/View/Form/Decorator/', 'decorator');
     $form->setDecorators(array('Tabs'));
     parent::_prepareForm($form);
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:15,代码来源:Form.php

示例15: _prepareContainer

 /**
  * Prepare container
  */
 protected function _prepareContainer()
 {
     if (Fox::getModel('extensionmanager/session')->getFormData()) {
         $this->editing = true;
         $this->addButton(array("type" => "button", "button_text" => "Generate Package", "url" => $this->getUrl("*/*/generate-package"), "style_class" => "form-button", "confirm" => true, "confirm_text" => "Unsaved changes to package may lost."));
     }
     $this->deleteButtonUrl = Fox::getUrl("*/*/delete");
     $this->setIsDeleteButtonEnabled(TRUE);
     parent::_prepareContainer();
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:13,代码来源:Add.php


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