Comments (3)
See
https://github.com/CodeIgniter-Chinese/CodeIgniter/blob/develop/system/core/Loader.php#L858
and
http://www.php.net/manual/en/function.extract.php
from codeigniter.
OH! Thank you very much, but why CodeIgniter Manual did not remind.
He should be added.
from codeigniter.
http://ellislab.com/codeigniter/user-guide/general/views.html
Let's try it with your controller file. Open it add this code:
<?php
class Blog extends CI_Controller {
function index()
{
$data['title'] = "My Real Title";
$data['heading'] = "My Real Heading";
$this->load->view('blogview', $data);
}
}
?>
Now open your view file and change the text to variables that correspond to the array keys in your data:
<html>
<head>
<title><?php echo $title;?></title>
</head>
<body>
<h1><?php echo $heading;?></h1>
</body>
</html>
from codeigniter.
Related Issues (20)
- Cannot redeclare class ci_exceptions HOT 16
- codeigniter如何以RDS方式连接数据库呢 HOT 4
- base_url 不定义时某些情况下 redirect 到 https HOT 1
- session类库失效时间有bug HOT 7
- 继承类的权限判断后中止执行并提示的需求 HOT 2
- CI不能被类include方式使用 HOT 4
- 关于input类的“不可见字符”被屏蔽的问题 HOT 2
- contoller repeat 2times 默认控制器重复执行 HOT 12
- I can not understand the "helper" function
- form_dropdown HOT 1
- smtp发中文内容乱码问题 HOT 1
- 校验提交的数组数据时的问题
- helper函数“download”在IE下下载中文文件乱码
- codeigniter 连接远程oracle HOT 2
- Message: mysql_errno(): XXX is not a valid MySQL-Link resource HOT 1
- default_controller is not working when enable_query_strings is enabled HOT 1
- session 设置memcached 驱动, 无法保存session
- CI default_controller setting HOT 1
- DB class trouble with pcntl
- PHP如果使用了ZendGuadLoader后CI加载session类会导致服务器500错误 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codeigniter.