Google Login
LINGOKET
(Member No:) LOGOUT
Speak study

코드이그나이터 영문 메뉴얼 News section , 영어 나 컴 고수님들의 해석 참여를 부탁합니다.

[United States->Korean] comment 0 Search 26 Vote 0 비추천 0 2021-02-18 14:45:43
Listen, Speak only works with apps and chrome browsers.
News section
What does the sentence above mean?
0
In the last section, we went over some basic concepts of the framework by writing a class that references static pages.
What does the sentence above mean?
0
We cleaned up the URI by adding custom routing rules.
What does the sentence above mean?
0
Now it’s time to introduce dynamic content and start using a database.
What does the sentence above mean?
0
Create a database to work with
What does the sentence above mean?
0
The CodeIgniter installation assumes that you have set up an appropriate database, as outlined in the requirements.
What does the sentence above mean?
0
In this tutorial, we provide SQL code for a MySQL database,
What does the sentence above mean?
0
and we also assume that you have a suitable client for issuing database commands (mysql, MySQL Workbench, or phpMyAdmin).
What does the sentence above mean?
0
You need to create a database that can be used for this tutorial, and then configure CodeIgniter to use it.
What does the sentence above mean?
0
Using your database client, connect to your database and run the SQL command below (MySQL).
What does the sentence above mean?
0
Also, add some seed records.
What does the sentence above mean?
0
For now, we’ll just show you the SQL statements needed to create the table,
What does the sentence above mean?
0
but you should be aware that this can be done programmatically once you are more familiar with CodeIgniter;
What does the sentence above mean?
0
you can read about Migrations and Seeds to create more useful database setups later.
What does the sentence above mean?
0
A note of interest: a “slug”, in the context of web publishing, is a user- and SEO-friendly short text used in a URL to identify and describe a resource.
What does the sentence above mean?
0
The seed records might be something like:
What does the sentence above mean?
0
Connect to your database
What does the sentence above mean?
0
The local configuration file, .env, that you created when you installed CodeIgniter, should have the database property settings uncommented and set appropriately for the database you want to use.
What does the sentence above mean?
0
Make sure you’ve configured your database properly as described here.
What does the sentence above mean?
0
Setting up your model
What does the sentence above mean?
0
Instead of writing database operations right in the controller, queries should be placed in a model, so they can easily be reused later.
What does the sentence above mean?
0
Models are the place where you retrieve, insert, and update information in your database or other data stores.
What does the sentence above mean?
0
They provide access to your data.
What does the sentence above mean?
0
You can read more about it here.
What does the sentence above mean?
0
Open up the app/Models/ directory and create a new file called NewsModel.php and add the following code.
What does the sentence above mean?
0
This code looks similar to the controller code that was used earlier.
What does the sentence above mean?
0
It creates a new model by extending CodeIgniter\Model and loads the database library.
What does the sentence above mean?
0
This will make the database class available through the $this->db object.
What does the sentence above mean?
0
Now that the database and a model have been set up,
What does the sentence above mean?
0
you’ll need a method to get all of our posts from our database.
What does the sentence above mean?
0
To do this, the database abstraction layer that is included with CodeIgniter — Query Builder — is used.
What does the sentence above mean?
0
This makes it possible to write your ‘queries’ once and make them work on all supported database systems.
What does the sentence above mean?
0
The Model class also allows you to easily work with the Query Builder and provides some additional tools to make working with data simpler.
What does the sentence above mean?
0
Add the following code to your model.
What does the sentence above mean?
0
With this code, you can perform two different queries.
What does the sentence above mean?
0
You can get all news records, or get a news item by its slug. You might have noticed that the $slug variable wasn’t sanitized before running the query;
What does the sentence above mean?
0
Query Builder does this for you.
What does the sentence above mean?
0
The two methods used here, findAll() and first(), are provided by the Model class.
What does the sentence above mean?
0
They already know the table to use based on the $table property we set in NewsModel class, earlier.
What does the sentence above mean?
0
They are helper methods that use the Query Builder to run their commands on the current table,
What does the sentence above mean?
0
and returning an array of results in the format of your choice. In this example, findAll() returns an array of objects.
What does the sentence above mean?
0
Display the news
What does the sentence above mean?
0
Now that the queries are written, the model should be tied to the views that are going to display the news items to the user.
What does the sentence above mean?
0
This could be done in our Pages controller created earlier,
What does the sentence above mean?
0
but for the sake of clarity, a new News controller is defined.
What does the sentence above mean?
0
Create the new controller at app/Controllers/News.php.
What does the sentence above mean?
0
Looking at the code, you may see some similarity with the files we created earlier.
What does the sentence above mean?
0
First, it extends a core CodeIgniter class, Controller, which provides a couple of helper methods,
What does the sentence above mean?
0
and makes sure that you have access to the current Request and Response objects, as well as the Logger class, for saving information to disk.
What does the sentence above mean?
0
Next, there are two methods, one to view all news items, and one for a specific news item.
What does the sentence above mean?
0
You can see that the $slug variable is passed to the model’s method in the second method.
What does the sentence above mean?
0
The model is using this slug to identify the news item to be returned.
What does the sentence above mean?
0
Now the data is retrieved by the controller through our model, but nothing is displayed yet.
What does the sentence above mean?
0
The next thing to do is, passing this data to the views.
What does the sentence above mean?
0
Modify the index() method to look like this:
What does the sentence above mean?
0
The code above gets all news records from the model and assigns it to a variable.
What does the sentence above mean?
0
The value for the title is also assigned to the $data['title'] element and all data is passed to the views.
What does the sentence above mean?
0
You now need to create a view to render the news items.
What does the sentence above mean?
0
Create app/Views/news/overview.php and add the next piece of code.
What does the sentence above mean?
0
We are again using esc() to help prevent XSS attacks.
What does the sentence above mean?
0
But this time we also passed “url” as a second parameter.
What does the sentence above mean?
0
That’s because attack patterns are different depending on the context in which the output is used.
What does the sentence above mean?
0
You can read more about it here.
What does the sentence above mean?
0
Here, each news item is looped and displayed to the user.
What does the sentence above mean?
0
You can see we wrote our template in PHP mixed with HTML. If you prefer to use a template language,
What does the sentence above mean?
0
you can use CodeIgniter’s View Parser or a third party parser.
What does the sentence above mean?
0
The news overview page is now done, but a page to display individual news items is still absent.
What does the sentence above mean?
0
The model created earlier is made in such a way that it can easily be used for this functionality.
What does the sentence above mean?
0
You only need to add some code to the controller and create a new view.
What does the sentence above mean?
0
Go back to the News controller and update the view() method with the following:
What does the sentence above mean?
0
Instead of calling the getNews() method without a parameter, the $slug variable is passed, so it will return the specific news item.
What does the sentence above mean?
0
The only thing left to do is create the corresponding view at app/Views/news/view.php.
What does the sentence above mean?
0
Put the following code in this file.
What does the sentence above mean?
0
Routing
What does the sentence above mean?
0
Because of the wildcard routing rule created earlier, you need an extra route to view the controller that you just made.
What does the sentence above mean?
0
Modify your routing file (app/Config/Routes.php) so it looks as follows.
What does the sentence above mean?
0
This makes sure the requests reach the News controller instead of going directly to the Pages controller.
What does the sentence above mean?
0
The first line routes URI’s with a slug to the view() method in the News controller.
What does the sentence above mean?
0
Point your browser to your “news” page, i.e., localhost:8080/news,
What does the sentence above mean?
0
you should see a list of the news items, each of which has a link to display just the one article.
What does the sentence above mean?
0
Listen, Speak only works with apps and chrome browsers.

 

원문 :  

https://www.codeigniter.com/user_guide/tutorial/news_section.html

 

위의 원문에 대한 댓글 해석및 설명을 부탁드립니다. 

Z Area
Recommender list

Introduction

A site that shares translations of everyday people around the world.
It is a site where you can repeat speaking, listening and practicing foreign language sentences.

QUICK MENU

  • How to upload articles

App

  • Google Play
  • App Store
상호:KRUZFACTORY|대표:이수민|호스팅제공자:KRUZFACTORY|개인정보책임자:이수민(croozfactory@gmail.com) COPYRIGHT (c)2017-2019 KRUZFACTORY CORP. ALL RIGHT RESERVED