Welcome Guest, Not a member yet? Register   Sign In
Query in CI Tutorial
#2

For 3 different values, I assume you mean 'templates/header', 'pages/'.$page and 'templates/footer'?

This is because first attribute points to template file, so these three lines pass the same data to three different template files.

For $data, views expect second parameter as array, so inside view file you can use array index as variable name to access that value:
$data['title'] = 'aaa' becomes <?= $title ?> in view file. Or $data['myvalue'] could be accessed using $myvalue.
Reply


Messages In This Thread
Query in CI Tutorial - by Sovani Shreeniwas - 01-07-2019, 02:49 AM
RE: Query in CI Tutorial - by Pertti - 01-07-2019, 03:40 AM
RE: Query in CI Tutorial - by php_rocs - 01-07-2019, 05:57 PM
RE: Query in CI Tutorial - by dave friend - 01-08-2019, 01:29 PM
RE: Query in CI Tutorial - by Sovani Shreeniwas - 01-09-2019, 03:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB