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


PHP view::factory方法代码示例

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


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

示例1: contact

 public function contact()
 {
     $this->setPageTitle('Контактная информация');
     $content = $this->_getContent(Model_Info::CONTENT_CONTACT);
     $text = isset($content[0]) ? $content[0] : '';
     $this->view->set('content', $text);
     $error = false;
     $postRawData = $this->input->post();
     if ($postRawData) {
         if ($postRawData['email'] or $postRawData['text']) {
             $message = view::factory('layout/email', array('email' => $postRawData['email'], 'text' => $postRawData['text']));
             $avalibleEmails = array('ktotutus@gmail.com', 'annab@mail.ru', 'nws83@mail.ru');
             $subject = 'contact from Brusnichka';
             $headers = 'MIME-Version: 1.0' . "\r\n";
             $headers .= 'Content-type: text/html; charset=utf8' . "\r\n";
             foreach ($avalibleEmails as $to) {
                 if (mail($to, $subject, $message, $headers)) {
                     $error = 'Успешно отправлено';
                 }
             }
         } else {
             $error = 'Заполните форму';
         }
     }
     $this->view->set('status', $error);
     $this->view->set('sections', Model_Section::instance()->getAll());
 }
开发者ID:ntcnhjdobr,项目名称:simpleSite,代码行数:27,代码来源:Info.php

示例2: run

 /**
  * run
  * the main() to this whole darned thing.
  *
  * @param array $configuration
  */
 public static function run(array $configuration)
 {
     define('DS', DIRECTORY_SEPARATOR);
     define('ROOT', __DIR__);
     // having short_open_tag enabled is a dirp
     // requirement.
     if (!ini_get('short_open_tag')) {
         throw new \Exception("The 'short_open_tag' setting MUST be enabled in your php.ini to use dirp, sorry!");
     }
     // setup the autoloader and the exception handler:
     set_exception_handler(array('\\dirp\\app', 'exception_handler'));
     static::_autoloader_init();
     static::$_cfg = new helper\params($configuration);
     static::$_http_request = http\request::factory($_GET, $_POST, $_SERVER);
     static::$_http_response = new http\response();
     // prepare addons:
     if ($addons = static::cfg()->addons) {
         addon\manager::load_addons((array) $addons);
     }
     // the master view is the frame/template around
     // the main content area. addons have access to
     // it directly through the \dirp\addon\base::master
     // method.
     static::$_master = view::factory('master/template', array('title' => 'dirp framework', 'body' => '', 'icon' => 'folder_heart.png', 'panels' => addon\event::fire('renderpanels', array('panels' => array()))->panels, 'css' => array(), 'js' => array(), 'head' => array()));
     addon\base::set_master_view(static::$_master);
     // dispatch the request and figure out what to do with
     // the controller's response:
     // TO-DO: HEY THE WAY CONTROLLER RETURNS ARE HANDLED IS KINDA FLAKY.
     if ($ret = router::dispatch(static::get_request(), static::get_response())) {
         if (is_string($ret)) {
             if (static::get_request()->is_ajax()) {
                 static::get_response()->header('content-type', 'text/plain');
                 static::get_response()->write($ret);
                 static::get_response()->send();
             } else {
                 static::get_master()->body = $ret;
             }
         }
     }
     static::get_response()->write(static::get_master()->render());
     addon\event::fire('shutdown', array());
     static::get_response()->send();
 }
开发者ID:TheShockTop,项目名称:dirp,代码行数:49,代码来源:app.php

示例3: load_interface

 private function load_interface($tools_array)
 {
     # admin interface
     if ($this->client->can_edit($this->site_id)) {
         # load admin global css and javascript.
         if (!file_exists(DOCROOT . '_assets/css/admin.css')) {
             $css = new Css_Controller();
             $css->admin();
         }
         $this->template->linkCSS('/_assets/css/admin.css');
         $this->template->admin_linkJS('get/js/admin?v=1.1');
         # get list of protected tools to compare against so we can omit scope link
         $protected_tools = ORM::factory('system_tool')->where('protected', 'yes')->find_all();
         $protected_array = array();
         foreach ($protected_tools as $tool) {
             $protected_array[] = $tool->id;
         }
         # Log in the $account_user admin account.
         #if(!$this->account_user->logged_in($this->site_id))
         #  $this->account_user->force_login('admin', (int)$this->site_id);
         # activate admin_panel view.
         $this->template->admin_panel = view::factory('admin/admin_panel', array('protected_array' => $protected_array, 'page_id' => $this->page_id, 'page_name' => $this->page_name, 'global_css_path' => "/_data/{$this->site_name}/themes/{$this->theme}/css/global.css?v=23094823-", 'tools_array' => $tools_array));
     } else {
         # load page css with tool css instances.
         $this->template->linkCSS("{$this->css_cache_url}/{$this->page_id}.css?v=1.0");
         # load the global javascript.
         $this->template->admin_linkJS('get/js/live?v=1.0');
         # Add requested javascript files if any are valid.
         if (!empty($_SESSION['js_files'])) {
             $this->template->linkJS($_SESSION['js_files']);
         }
     }
     # Renew Javascript file requests
     unset($_SESSION['js_files']);
 }
开发者ID:plusjade,项目名称:plusjade,代码行数:35,代码来源:build_page.php

示例4: array

<div class="rest_search">
	<div align="center"><h2 style="color:#62BBE8;margin:0">Find A Dish In The Menu</h2></div>
	<div class="dashed"></div>
	<div class="clear" style="height:20px"></div>
	<?php 
echo Form::open(NULL, array('id' => 'dish_search_form'));
?>
	<div style="width:46%;float:left;display:inline; padding-left:20px">
		<?php 
echo view::factory('site\\orders\\cart.php')->set('from_dish', 0)->set('current_dish_id', 0)->set('current_rest_id', $rest_id);
?>
	</div>
	<div style="width:48%;float:left;display:inline; padding-left:20px">
		<?php 
echo Form::Label('Dish Name');
?>
		<?php 
echo Form::input('dish_name', '', array('id' => 'dish_name', 'class' => 'dish_search_input '));
?>
		<div class="clear" style="height:10px"></div>
		<?php 
echo Form::Label('Ingredient');
?>
		<?php 
echo Form::input('auto_ingredient', NULL, array('class' => 'auto_ingredient dish_search_input'));
?>
		<div class="clear" style="height:10px"></div>
		<?php 
echo Form::Label('max_price', 'Max Price', array('class' => 'label_search_rest'));
?>
		<?php 
开发者ID:nemni8,项目名称:Munch,代码行数:31,代码来源:dishesfilter.php

示例5: action_index

 public function action_index()
 {
     $this->_response = view::factory('main', array('username' => $this->_options['username'], 'uid' => $this->_uid))->render();
 }
开发者ID:romancient,项目名称:php-testtask,代码行数:4,代码来源:welcome.php

示例6: _e

		<div class="control-group">
			<label for="new-category-name"><?php 
_e('Name');
?>
</label>
			<input type="text" id="new-category-name" class="input" />
		</div>
		<div class="control-group">
			<label for="new-category-parent"><?php 
_e('Parent');
?>
</label>
			<select id="new-category-parent">
<?php 
if ($content->contenttype->supports('categories')) {
    $view = view::factory('Cms/Content/categories/dropdown');
    $view->content = $content;
    echo $view->render();
}
?>
			</select>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal"><?php 
_e('Cancel');
?>
</button>
		<button class="btn btn-primary" data-contentid="<?php 
echo $content->id;
?>
开发者ID:artbypravesh,项目名称:morningpages,代码行数:31,代码来源:edit.php

示例7: array

<?php

echo $header;
?>
<div id="content">
<?php 
echo $content;
?>
</div>
<?php 
echo view::factory('viewinview/footer', array('copyright' => $copyright));
开发者ID:nicka1711,项目名称:hanami,代码行数:11,代码来源:container.php

示例8:

		</div>
		<h3 class="widget-title pull-left">
			<span></span><?php 
echo $block->blocktype->display;
?>
</span>
			<small data-bind="text:excerpt"></small>
		</h3>
		<?php 
//if($block->blocktype->min != 1):
?>
			<div class="widget-tool pull-right">
				<a data-bind="click:removeme" href="#" class="block-deleter" title="Slet denne blok">
					<span class="glyphicon glyphicon-trash"></span>
				</a>
			</div>
		<?php 
//endif;
?>
	</div>
	<div <?php 
/*style="background:<?php echo $colors[rand(0,count($colors)-1)] ?>;"*/
?>
 class="widget-body" data-bind="css{hide:collapsed()=='1'}">
<?php 
$blockview = view::factory('Cms/Content/blocks/' . $block->blocktype->type);
$blockview->block = $block;
echo $blockview->render();
?>
	</div>
</div>
开发者ID:artbypravesh,项目名称:morningpages,代码行数:31,代码来源:block.php

示例9: set_view

 public function set_view($viewname)
 {
     $this->template->view = view::factory($viewname);
 }
开发者ID:artbypravesh,项目名称:morningpages,代码行数:4,代码来源:Cms.php

示例10: array

<div align="center"  class="order_left_div">
	<div class="header_bg" style="margin-top:10px;margin-right:10px">
		<div class="order_ingred_con" style="margin:10px;width:60%">
			<?php 
echo html::image('media/images/dish_icon.png', array('alt' => $dish->name, 'class' => 'image'));
?>
		</div>
	</div>
	<div style="margin-top:10px">
		<?php 
echo view::factory('site\\orders\\cart.php')->set('from_dish', 1)->set('current_dish_id', $dish->id)->set('current_rest_id', $dish->restaurant->id);
?>
	</div>
</div>
<div class="order_right_div">
    <?php 
$edit_id = $type == 'edit' ? '/' . $orderdish_id : NULL;
?>
	<?php 
echo Form::open('main/dishordercreate/' . $dish->id . $edit_id, array('id' => 'form_dishorder'));
?>
    <div class="paper_gray"><div class="header_bg"><h1 align="center" style="margin-top:0px;"><?php 
echo $dish->name;
?>
</h1></div></div>
	<?php 
if (strlen($dish->description) > 0) {
    ?>
		<div class="descrption_con">
			<p class ="description">
				<?php 
开发者ID:nemni8,项目名称:Munch,代码行数:31,代码来源:order_dish.php

示例11: foreach

<?php

if ((bool) $files->count()) {
    $view = view::factory('cms/files/parts/filebrowser-modal-file');
    foreach ($files as $file) {
        $currentview = $view;
        $currentview->file = $file;
        echo $currentview->render();
    }
}
开发者ID:artbypravesh,项目名称:morningpages,代码行数:10,代码来源:filebrowser-files.php


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