Pogledajte određenu poruku
Staro 11. 07. 2012.   #13
webarto
expert
Grand Master
 
Avatar webarto
 
Datum učlanjenja: 11.04.2010
Poruke: 998
Hvala: 141
959 "Hvala" u 153 poruka
webarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished road
Default

pogledaj Kohana Framework, taj update može biti jednostavan kao ovo...

PHP kôd:
    public function action_update()
    {
        
$id $this->request->param('id');

        if(
$this->request->method() == 'POST')
        {
            
$post ORM::factory('post'$id)
                    ->
values($this->request->post(), array('category_id''title''content'))
                    ->
save();
        }
        
        
$post ORM::factory('post'$id);
        
        
$categories DB::select()
        ->
from('categories')
        ->
execute()
        ->
as_array('id''title');

        
$post_view View::factory('post.update', array(
            
'post' => $post,
            
'categories' => $categories,
        ));
        
        
$this->view->content $post_view;
    } 
__________________
Github // LinkedIn // PHP // ZCE // Stackoverflow PHP // Site5 Web Hosting
webarto je offline   Odgovorite uz citat