Welcome Guest, Not a member yet? Register   Sign In
using a template and sending varables via the DB
#1

[eluser]R_Nelson[/eluser]
this is what i do now to use a template.
Code:
$data['title'] = ''; // title = page title
$data['discription'] = ''; // discription = discription for meta
$data['keyword'] = '';//keyword = keywords for meta
$data['main_content'] = 'login';    
$this->load->view('includes/template', $data); // calls template
what i was thinking about doing was set up a DB with these 4 rows and controller name then use active record to fetch these and load the page but my question is would it slow down the loading of my pages or would they be just fine?
#2

[eluser]InsiteFX[/eluser]
Yes, because now you would be accessing the database!

But a lot of users do use the database, best to give it a try and see how it affects page loading.

InsiteFX
#3

[eluser]R_Nelson[/eluser]
sounds good I'll give it a try will keep my code DRY anyways




Theme © iAndrew 2016 - Forum software by © MyBB