Anyway, in short, here are some new things wrt coding tutorial:
- Using hook() function called hook_block_view(). This function is used to display out the block content onto the page. the function has passing variable, i name it as $param where it stores the unique id (aka name) of the block.
- Use of switch to filter only id=buat_sendiri. This means, there could be a lot other blocks in any regions that carry their own IDs or names.
- The use of array variable where i must assign at least 2 key name; (1) subject (2) content. I need to assign 'subject' and 'content' with appropriate names and content values.
- using the custom function that i've written earlier, namely buat_sendiri_content(). This function passes the result in array format to a new defined array parameter called $result.
- create one array that will store all iterated data from $result. This can be achieved using foreach(). Here i call the new array as $item
- assigning the iterated data like this -> $item[] = array ('data' => iterated-data);
- After completing foreach(), need to assign 'content' with values from $item[].
- Using theme() <------ This one aku kurang faham lagi!!!


No comments:
Post a Comment