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


PHP Website::initialize方法代码示例

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


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

示例1: operations

 public function operations($type)
 {
     switch ($type) {
         case 'general_settings':
             $this->load->model('entities/website');
             $temp = new Website();
             $temp->initialize($this->input->post());
             WebsiteManagement::update_website($temp);
             redirect(base_url() . "panel/general_settings", "location");
             break;
         case 'supprimer_portfolio':
             $data = $this->input->get();
             $id = $data['id'];
             PortfolioManagement::delete_portfolio_content($id);
             redirect(base_url() . "panel/page/portfolio", "location");
             break;
         case 'supprimer_post':
             $data = $this->input->get();
             $id = $data['id'];
             BlogManagement::delete_blog_post($id);
             break;
         case 'editer_post':
             $this->load->model('entities/Post');
             $post = BlogManagement::get_post($this->input->post('id'));
             $post->title = $this->input->post('title');
             $post->description = $this->input->post('description');
             $post->content = $this->input->post('content');
             BlogManagement::update_blog_post($post);
             echo 'ok';
             break;
         case 'ajouter_post':
             $this->load->model('entities/Post');
             $temp = new Post();
             $temp->initialize($this->input->post());
             BlogManagement::insert_blog_post($temp);
             echo 'ok';
             break;
         case 'upload_slider_image':
             # Started working with file upload.
             $validFiles = array('upload_path' => './assets/front/img/slider_images', 'allowed_types' => 'jpg|png', 'file_name' => 'slider_image_' . $this->input->post('slide_to_update') . '.jpg', 'max_size' => 250000, 'overwrite' => TRUE);
             $this->load->library('upload', $validFiles);
             $this->load->model('entities/SliderImage');
             $slider_entry = SliderManagement::get_slider_entry($this->input->post('slide_to_update'));
             $slider_entry->title = $this->input->post('article_title');
             $slider_entry->description = $this->input->post('article_description');
             if ($this->upload->do_upload('to_upload_image')) {
                 $slider_entry->image = 'slider_image_' . $this->input->post('slide_to_update') . '.jpg';
             } else {
                 echo $this->upload->display_errors();
             }
             SliderManagement::update_slider($slider_entry);
             redirect(base_url() . "panel/page/accueil", "location");
             break;
         default:
             break;
     }
 }
开发者ID:adilbk,项目名称:youp,代码行数:57,代码来源:Panel.php


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