 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
DevShed: Using Nested Views with CodeIgniter
by Chris Cornutt April 03, 2009 @ 07:56:01
The "Introduction to CodeIgniter" series continues on DevShed with this new article, a look at nested views in their sample application.
In this third chapter of the series I'm going to discuss one that bases its functionality on the loader class that comes bundled with CI. [...] By means of this method, it is very simple to replace in one single step all the variables included into multiple views with actual data. Therefore, in the next few lines I'm going to discuss how to use it to generate a dynamic web document, which will display some database contents.
After a quick review of loading views sequentially, they look at the new stuff - a "master view" that can load multiple other views inside. To pass information into this master view, they use the "$this->load->vars()" method included in the framework.
voice your opinion now!
nested views codeigniter framework load variables
WebReference.com: The Building Blocks Data Types, Literals, Variables, and Constants - Part 2
by Chris Cornutt January 22, 2007 @ 09:52:00
WebReference.com has posted part two in a series looking at the "building blocks" that make up PHP and its use. This time, it's a look at the containers for your data - the data types, literals, variables, and constants.
They go through each, explaining what they are, how they're used and when you'd want to use them in your code. They explain the data types and how those fit with each "container" and some basic things like valid names and how to assign things correctly.
They even get get into working with variables from GET and POST requests as well as working with the scope of variables and getting the metadata about them (is it an integer? is it empty?)
voice your opinion now!
building blocks datatypes literals variables constants tutorial building blocks datatypes literals variables constants tutorial
Sara Golemon's Blog: Compiled Variables
by Chris Cornutt May 24, 2006 @ 17:39:32
In a new post from her blog today, Sara Golemon seeks to dispell any FUD that might come up surrounding compiled variables (as there's already some issues raised in this interview).
Last month at php|tek I gave a presentation on "How PHP Ticks" where I covered, among other things the process of compiling source code into opcodes (an intermediate psuedo-language similar to what java calls "bytecode" or what .NET calls "MSIL"). As part of this section of the presentation, I showed one of the more interresting changes between ZE 2.0 (PHP 5.0) and ZE 2.1 (PHP 5.1), namely: How variables are retreived and used in an operation. More specifically, how they provide a small, yet cumulative, speedup to applications in a way that's transparent to the end-user -- One more reason to like PHP 5.1 right?
After listening to Marcus Whitney's interview with Brion Vibber of WikiMedia in which he mentions my presentation and makes reference to this engine change, I realized that I should clarify what this feature is (and more importantly, what it isn't) before any FUD spreads.
She describes what they are with an illustration using a simple PHP script and breaking it out into the compiled version's parts - both in PHP4 and the PHP5 versions. Of course, representing what they are needs a flipside, so she presents a look at what they are *not* as well. There's also a brief mention of the special status that globals and static variables get outside the norm.
voice your opinion now!
compiled variables confusion interview php4 php5 compiled variables confusion interview php4 php5
Vidyut Luther's Blog: "Where do you 'define' your environment variables" ...update/workaround/s
by Chris Cornutt January 23, 2006 @ 06:41:21
On his blog, phpcult.com, today, Vidyut Luther has posted an update to his previous post asking where people usually define their settings.
My last post created a lot of conversation about how one should go about setting configuration options for your code. I realized, no one mentioned the use of PHP's built in parse_ini_file.
function. This seems to address my problems with one large monolothic file pretty easily. I can still have a globals.conf.php which handles global settings, but I can also use this ini file, to load specific things that are only necessary for modules on an as needed basis. The global scope would be aware of the CONFIG_FILE constant, and I can parse specific sections of it whenever I need to.
He notes that he'll try it in the next few days, but I imagine he'll like what he sees - especially if he's looking for a simple, external way to change information in a file and have it affect the entire app (without changing code).
voice your opinion now!
define environment variables update parse_ini_file define environment variables update parse_ini_file
|
Community Events
Don't see your event here? Let us know!
|