About

Breaking

Wednesday 10 May 2017

Create a Post Model

The Model class is the bread and butter of CakePHP applications. By creating a CakePHP model that will interact with our database, we’ll have the foundation in place needed to do our view, add, edit, and delete operations later.
CakePHP’s model class files go in /app/Model, and the file we’ll be creating will be saved to /app/Model/Post.php. The completed file should look like this:


मॉडल वर्ग केपीपीएचपी अनुप्रयोगों की रोटी और मक्खन है। एक CakePHP मॉडल बनाकर, जो हमारे डेटाबेस से इंटरैक्ट करेगा, हमारे पास बाद में ऑपरेशन को देखने, जोड़ना, संपादित करने और हटाने के लिए हमारे पास नींव होगा।

केकपीएचपी की मॉडल वर्ग फाइलें / ऐप / मॉडल में जाते हैं, और हम जो फाइल बना रहे हैं उसे /app/Model/Post.php में सहेजा जाएगा। पूरी फाइल इस तरह दिखनी चाहिए:



class Post extends AppModel { }

 

 

Naming conventions are very important

in CakePHP. By naming our model Post,CakePHP can automatically infer that this model will be used in the PostsController, and will be tied to a database table called posts.


केपीपीएचपी में नामकरण सम्मेलनों बहुत महत्वपूर्ण हैं। हमारे मॉडल पोस्ट का नाम देकर, केकपीएचपी स्वचालित रूप से अनुमान लगा सकता है कि इस मॉडल का उपयोग पोस्टकंट्रोलर में किया जाएगा, और उसे डाक नामक डेटाबेस तालिका से जोड़ा जाएगा।

 

No comments:

Post a Comment