本文整理汇总了PHP中Presenter::forge方法的典型用法代码示例。如果您正苦于以下问题:PHP Presenter::forge方法的具体用法?PHP Presenter::forge怎么用?PHP Presenter::forge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Presenter
的用法示例。
在下文中一共展示了Presenter::forge方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_index
public function action_index($view_path, $id)
{
$post_input = Input::post();
// First of all turn the submitted data into a FuelPHP model representation.
$form_data_object = new \EBS\Form_Data($post_input);
// Now go through and save created models and run validation.
$model_validation = new \EBS\Form_Save_Models($form_data_object->models_and_actions);
if (!$model_validation->run()) {
$this->response->highlight_fields = $model_validation->get_highlightfields();
foreach ($model_validation->database_errors as $database_error) {
// Create alerts specific to database errors for debugging purposes.
// Perhaps this should only be shown if in DEV environment.
$this->response->alerts[] = new \EBS\Response_Alert("There was a database error! Message: {$database_error->getMessage()}", 'danger', '', 0);
}
} else {
// If that's successful, set the response success to true, as we're all done!
$this->response->success = true;
// Check if there was a view to generate and send back as well.
if ($view_path !== null) {
// Get the path for the view request.
$view_path = str_replace('_', '/', $view_path);
$updated_view = new \EBS\Response_View();
$updated_view->html = Presenter::forge($view_path)->set('id', $id)->render();
$updated_view->context = Input::post('response_target');
$this->response->updated_views[] = $updated_view;
}
}
// Encode the response object as JSON and send it back to the UI!
return Response::forge(json_encode($this->response));
}
示例2: action_index
public function action_index()
{
$exports = ['news' => Presenter::forge('portal/component/news'), 'slider' => View_Twig::forge('portal/component/slider')];
$this->template->title = 'Metro Royal';
$this->template->navigation = View_Twig::forge('portal/_navigation');
$this->template->content = View_Twig::forge('portal/index', $exports);
}
示例3: action_index
/**
*
*/
public function action_index()
{
Package::load('oil');
\Oil\Generate_Scaffold::forge(['page1', 'title:string', 'content:text'], "orm");
$this->title = 'Backend Dashboard';
$this->template->content = Presenter::forge('backend/page');
}
示例4: action_search
public function action_search()
{
$coupons = "";
try {
$coupons = unserialize(Cache::get('cache_coupons'));
} catch (\CacheNotFoundException $e) {
$curl = Request::forge('http://allcoupon.jp/api-v1/coupon', 'curl');
$curl->set_params(array('output' => 'json', 'apikey' => '9EBgSyRbAPmutrWE'));
// this is going to be an HTTP POST
$curl->set_method('get');
$curl->set_auto_format(true);
$result = $curl->execute()->response();
$coupons = json_decode($result->body);
Cache::set('cache_coupons', serialize($coupons), 300);
}
if ($area = Input::get('area')) {
$coupons = array_filter($coupons, function ($v, $k) {
return $v->coupon_area == Input::get('area');
}, ARRAY_FILTER_USE_BOTH);
}
if ($category = Input::get('category')) {
$coupons = array_filter($coupons, function ($v, $k) {
return $v->category_name == Input::get('category');
}, ARRAY_FILTER_USE_BOTH);
}
$view = Presenter::forge('home/search');
$view->set('title', $area, false);
$view->set('area', $area, false);
$view->set('category', $category, false);
$view->set('coupons', $coupons, false);
$this->template->content = $view;
}
示例5: action_index
public function action_index()
{
/**
* Communication
*/
$this->template->content = Presenter::forge('skills/page', 'communication_view');
// $this->template->content = Presenter::forge('skills/communication');
}
示例6: action_index
public function action_index()
{
/**
* Art and Design
*/
$this->template->content = Presenter::forge('skills/page', 'design_view');
// $this->template->content = Presenter::forge('skills/design');
}
示例7: action_index
public function action_index()
{
/**
* Web Development
*/
// $this->template->content = Presenter::forge('skills/development');
$this->template->content = Presenter::forge('skills/page', 'development_view');
}
示例8: action_index
public function action_index()
{
/**
* Information Management.
*/
$this->template->content = Presenter::forge('skills/page', 'information_view');
// $this->template->content = Presenter::forge('skills/information');
}
示例9: action_404
public function action_404()
{
$messages = array('Uh Oh!', 'Huh ?');
$data['notfound_title'] = $messages[array_rand($messages)];
$data['title'] = '<h1>404 Times</h1>';
$this->template->title = __('page-not-found');
$this->template->content = Presenter::forge('frontpage/page')->set('content', View::forge('404', $data));
}
示例10: action_view
public function action_view($id = null)
{
$article = Model_Article::find_by_url_title($id);
if ($article) {
$view = Presenter::forge('article/view');
$view->set('article', $article);
$this->template->set('content', $view);
} else {
return Response::forge(Presenter::forge('welcome/404'), 404);
}
}
示例11: action_index
public function action_index($view = 'basic')
{
// Put navigation view into header
$this->_header->set('navigation', $this->_navigation);
// Grab presenter to be used for layout
$presenter = Presenter::forge('account/page')->set('header', $this->_header);
// Get view and place in presenter
$data['user'] = $this->_user;
$view = View::forge('account/' . $view . '/index', $data);
$presenter->set('content', $view);
$this->template->content = $presenter;
}
示例12: view
public function view()
{
$initial_content = '';
$meta_description = '';
$organisation = '';
$assets = [Asset::css(['ebs.css', 'bootstrap.css']), Asset::js(['jquery-2.1.4.js', 'ebs.js', 'bootstrap.js', 'confirm-bootstrap.js'])];
$nav_header = Presenter::forge('layouts/index/header');
$content = View::forge('layout/content', ['content' => $initial_content]);
$nav_footer = Presenter::forge('layouts/index/footer');
$ebs = View::forge('layout/ebs', ['meta_description' => $meta_description, 'organisation' => $organisation, 'assets' => $assets, 'nav_header' => $nav_header, 'content' => $content, 'alert_area' => View::forge('layout/alert_area'), 'nav_footer' => $nav_footer], false);
$this->ebs = $ebs;
}
示例13: action_index
public function action_index()
{
// Put navigation view into header
$this->_header->set('navigation', $this->_navigation);
// Grab presenter to be used for layout
$presenter = Presenter::forge('image/page')->set('header', $this->_header);
/*
* TODO Grab img URL then encode image
* return image
*/
$view = View::forge('image/encoder');
$presenter->set('content', $view);
$this->template->content = $presenter;
}
示例14: action_index
/**
* @author Thuanth6589 <thuanth6589@seta-asia.com.vn>
* action create/edit media
*/
public function action_index()
{
$m_media_id = Input::get('id', null);
$filter_group = $this->filter_group;
$datafilter['field'] = $filter_group;
$media = new \Model_Mmedia();
if (isset($m_media_id)) {
$media = \Model_Mmedia::find_by_pk($m_media_id);
if (!isset($media)) {
Session::set_flash('error', '媒体は存在しません');
return Response::redirect('/master/medias');
}
$datafilter['datafilter'] = \Presenter_Group_Filter::edit($filter_group['step'], $filter_group['type'], $media->partner_code);
$data['media'] = $media;
$data['posts'] = \Model_Mpost::find_by_m_media_id($m_media_id);
}
$data['media_name_existed'] = $media->get_list_media('media_name');
$data['media_version_name_existed'] = $media->get_list_media('media_version_name');
if (Input::method() == 'POST') {
$url = Session::get('medias_url') ? Session::get('medias_url') : Uri::base() . 'master/medias';
$m_media_id = Input::post('m_media_id', null);
if ($m_media_id && !\Model_Mmedia::find_by_pk($m_media_id)) {
Session::set_flash('error', '媒体は存在しません');
return Response::redirect($url);
}
if (!\Model_Mpartner::find_by_pk(Input::post('partner_code'))) {
Session::set_flash('error', '取引先(受注先)は存在しません');
} else {
$media = new \Model_Mmedia();
$media_data = $media->set_data(Input::post());
$umedia = new \Model_Umedia();
$posts = Input::post('post') != null ? Input::post('post') : array();
if ($umedia->save_media($media_data, $posts, Input::post('m_media_id'))) {
Session::set_flash('success', \Constants::$message_create_success);
return Response::redirect($url);
}
Session::set_flash('error', \Constants::$message_create_error);
}
}
$data['classification'] = \Constants::get_create_media_classification();
$this->template->title = 'UOS求人システム';
$this->template->content = View::forge('media', $data);
$this->template->content->filtergroup = \Presenter::forge('group/filter')->set('custom', $datafilter);
}
示例15: action_index
/**
* @author Thuanth6589 <thuanth6589@seta-asia.com.vn>
* action create/update ss
*/
public function action_index()
{
$ss_id = Input::get('ss_id');
$filter_group = $this->filter_group;
$data_filter['field'] = $filter_group;
if (isset($ss_id)) {
$ss = \Model_Mss::find_by_pk($ss_id);
if (!isset($ss)) {
Session::set_flash('error', 'SSは存在しません');
return Response::redirect('/master/sslist');
}
$data['ss'] = $ss;
$data['json'] = $ss->edit_data != '' ? json_decode($ss->edit_data) : $ss;
$data_filter['datafilter'] = \Presenter_Group_Filter::edit($filter_group['step'], $filter_group['type'], $data['json']->partner_code);
$partner = \Model_Mpartner::find_by_pk($ss->partner_code);
$group = \Model_Mgroups::find_by_pk($partner->m_group_id);
$data['branch_name'] = $partner->branch_name;
$data['group_name'] = $group->name;
$data['is_view'] = $this->_compare_data_json($ss, $ss->edit_data);
}
$submit = Input::post('submit');
if (isset($submit)) {
$url = Session::get('sslist_url') ? Session::get('sslist_url') : Uri::base() . 'master/sslist';
$ss = new \Model_Mss();
$ss->set_data(Input::post());
if (isset($ss->fields['ss_id']) && !\Model_Mss::find_by_pk($ss->fields['ss_id'])) {
Session::set_flash('error', 'SSは存在しません');
return Response::redirect($url);
}
if (!\Model_Mpartner::find_by_pk(Input::post('partner_code'))) {
Session::set_flash('error', '取引先(受注先)は存在しません');
} else {
if ($ss->save_data()) {
Session::set_flash('success', \Constants::$message_create_success);
return Response::redirect($url);
}
Session::set_flash('error', \Constants::$message_create_error);
}
}
$data['address1'] = \Constants::get_create_address();
$this->template->title = 'UOS求人システム';
$this->template->content = View::forge('ss', $data);
$this->template->content->filtergroup = \Presenter::forge('group/filter')->set('custom', $data_filter);
}