CakePHP Cookbook 2.x
Configuration A Note on mod_rewrite Blog Tutorial - Adding a layer Create a Post Model Create a Posts Controller Creating Post Views Adding Posts Data Validation Editing Posts Deleting Posts Routes Conclusion Configuration A Note on mod_rewrite Blog Tutorial - Adding a layer Create a Post Model Create a Posts Controller Creating Post Views Adding Posts Data Validation Editing Posts Deleting Posts Routes Conclusion created) VALUES ('The title', 'This is the post body.', NOW()); INSERT INTO posts (title, body, created) VALUES ('A title once again', 'And the post body follows.', NOW()); INSERT INTO posts (title0 码力 | 1096 页 | 958.62 KB | 1 年前3
CakePHP Cookbook 2.x
body, created) VALUES ('The title', 'This is the post body.', NOW()); INSERT INTO posts (title, body, created) VALUES ('A title once again', 'And the post body follows.', NOW()); INSERT INTO posts (title more information, but suffice it to say that naming our table ‘posts’ automati- cally hooks it to our Post model, and having fields called ‘modified’ and ‘created’ will be automagically managed by CakePHP layer to start building your first CakePHP application. Blog Tutorial - Adding a layer Create a Post Model The Model class is the bread and butter of CakePHP applications. By creating a CakePHP model0 码力 | 820 页 | 2.52 MB | 1 年前3
CakePHP Cookbook 4.x
be: public function add() { $user = $this->Users->newEmptyEntity(); if ($this->request->is('post')) { $user = $this->Users->patchEntity($user, $this->request- >getData()); if ($t (user_id, title, slug, body, published, created, modified) VALUES (1, 'First Post', 'first-post', 'This is the first post.', 1, NOW(), NOW()); If you are using PostgreSQL, connect to the cake_cms database (user_id, title, slug, body, published, created, modified) VALUES (1, 'First Post', 'first-post', 'This is the first post.', TRUE, NOW(), NOW()); You may have noticed that the articles_tags table used0 码力 | 1249 页 | 1.04 MB | 1 年前3
CakePHP Cookbook Documentation 5.xbe: public function add() { $user = $this->Users->newEmptyEntity(); if ($this->request->is('post')) { $user = $this->Users->patchEntity($user, $this->request- >getData()); if ($t (user_id, title, slug, body, published, created, modified) VALUES (1, 'First Post', 'first-post', 'This is the first post.', 1, NOW(), NOW()); If you are using PostgreSQL, connect to the cake_cms database (user_id, title, slug, body, published, created, modified) VALUES (1, 'First Post', 'first-post', 'This is the first post.', TRUE, NOW(), NOW()); You may have noticed that the articles_tags table uses0 码力 | 1080 页 | 939.39 KB | 1 年前3
CakePHP Cookbook 4.x
Release 4.x public function add() { $user = $this->Users->newEmptyEntity(); if ($this->request->is('post')) { $user = $this->Users->patchEntity($user, $this->request->getData()); if ($this->Users->save($user articles (user_id, title, slug, body, published, created, modified) VALUES (1, 'First Post', 'first-post', 'This is the first post.', 1, NOW(), NOW()); If you are using PostgreSQL, connect to the cake_cms database articles (user_id, title, slug, body, published, created, modified) VALUES (1, 'First Post', 'first-post', 'This is the first post.', TRUE, NOW(), NOW()); You may have noticed that the articles_tags table used0 码力 | 967 页 | 2.88 MB | 1 年前3
CakePHP Cookbook Documentation 5.xRelease 5.x public function add() { $user = $this->Users->newEmptyEntity(); if ($this->request->is('post')) { $user = $this->Users->patchEntity($user, $this->request->getData()); if ($this->Users->save($user articles (user_id, title, slug, body, published, created, modified) VALUES (1, 'First Post', 'first-post', 'This is the first post.', 1, NOW(), NOW()); If you are using PostgreSQL, connect to the cake_cms database articles (user_id, title, slug, body, published, created, modified) VALUES (1, 'First Post', 'first-post', 'This is the first post.', TRUE, NOW(), NOW()); You may have noticed that the articles_tags table uses0 码力 | 848 页 | 2.53 MB | 1 年前3
CakePHP Cookbook 3.x
would be: public function add() { $user = $this->Users->newEntity(); if ($this->request->is('post')) { $user = $this->Users->patchEntity($user, $this->request- >getData()); if ($t (user_id, title, slug, body, published, created, modified) VALUES (1, 'First Post', 'first-post', 'This is the first post.', 1, now(), now()); You may have noticed that the articles_tags table used parameter, but where does that parameter come from? If a user requests /articles/view/first-post, then the value ‘first-post’ is passed as $slug by CakePHP’s routing and dispatching layers. If we reload our browser0 码力 | 1244 页 | 1.05 MB | 1 年前3
CakePHP Cookbook 3.x
Release 3.10 public function add() { $user = $this->Users->newEntity(); if ($this->request->is('post')) { $user = $this->Users->patchEntity($user, $this->request->getData()); if ($this->Users->save($user articles (user_id, title, slug, body, published, created, modified) VALUES (1, 'First Post', 'first-post', 'This is the first post.', 1, now(), now()); You may have noticed that the articles_tags table used a parameter, but where does that parameter come from? If a user requests /articles/view/ first-post, then the value ‘first-post’ is passed as $slug by CakePHP’s routing and dispatching layers. If we reload our browser0 码力 | 967 页 | 2.80 MB | 1 年前3
共 8 条
- 1













