Saw this on digg, thought this was pretty cool.
http://www.buzzfeed.com/nikoguy1/penny-shooter-business-card-5xy

Saw this on digg, thought this was pretty cool.
http://www.buzzfeed.com/nikoguy1/penny-shooter-business-card-5xy

Lets say you’re inside an action in /app/plugins/plugin/controllers/my_controller.php and you want to render /app/plugins/plugin_2/views/form.ctp. You would probably do something along the lines of:
function action() { //Do some things here $this->render(APP . "plugins/plugin_2/views/form.ctp"); }
That will not work, unfortunately. It will try and render /app/plugins/plugin/plugins/plugin_2/views/form.ctp. So, how can you do this? Lets take a look at the $this->render function:
$this->render(string $action, string $layout, string $file);
Note the $file parameter. This is what we want. A quick look through the CakePHP code revealed that if you pass false for the $action parameter, CakePHP will try and use $file instead. Passing null as the layout parameter will use the default layout.
$this->render(false, null, APP . "views/file.ctp");
Or perhaps if you need to render a view file of a plugin?
$this->render(false, null, APP . "plugins/plugin_name/views/file.ctp");
The APP constant holds the absolute path to your CakePHP project’s app directory.
There isn’t too much I can really write about this, so I’m just going to get straight to the point. To check if an element exists, with jQuery, you do this:
if ($('element').length == 0) { //Element does not exist } else { //Element exists }
Or you can just do:
if ($('element').length) { //Element exists }
Fairly simple. If you wanted to do it with regular javascript, you would just do:
if(document.getElementById('element_id')) { //Element exists }
So I’ve finally decided to completely switch atomiku.com over to wordpress. The crappy CMS I had built for atomiku.com’s purpose 2 years ago was just too… crap. Wordpress is a really nice CMS. I think I’m going to have a lot of fun with this.
A few things I still need to do, though. One of the things is to *finally* get atoChat v0.7 finished. Another is to write more interesting things, like web development tutorials, tips, etc. This is something I’ll be doing soon, hopefully.
Anyways, yeah. Enjoy the new website. Or, don’t.
Also: Follow me on twitter! http://twitter.com/atomiku
Hey hey! Just to let you know atoChat is going pretty well and that I HAVE been working on it, I promise!
A few things added to atoChat v0.7:
There are many more things changed/added to v0.7, but perhaps I’ll let them be a surprise
In an attempt to write more interesting things for atomiku.com, I’m going to write a little bit about Google Analytics today. If you already use Google Analytics on your website then stop reading now, I’m only going to be going through the basics.
So, what is Google Analytics? It’s an amazing web application that allows you to see the performance of your website. It saves down all sorts of information such as what browsers your visitors are using, where they came from, what keywords they used to find your site on google, what screen resolution they’re using and all sorts of other interesting and important information. Although, I’m not going to go through it all because it would take absolutely ages.
I recommend Google Analytics to anyone who runs a website and is interested in what is going on with their visitors. To get Google Analytics installed and working on your website, the first step would be to go to http://www.google.com/analytics/. If you already have a google account (Which you WILL have if you use GMail) you can click “Access Analytics” and login as normal. If you don’t have a google account, click “Sign Up Now” and get yourself registered.
Once you’re logged into Google Analytics, you should be given a sign up page if you’ve never used it before. Click the sign up button and get the form filled in. Once you’re all done, you will be given a block of javascript code to put at the top of your website, in the <head> tags. Get that put in and you’re all ready to go! You’ll have to give the analytics data some time to update, it appears to be updated daily so you may have to wait till the next day to see anything interesting.
Well, hopefully I’ve covered everything. Do leave me a comment if you found this helpful, or if you need more help. Thanks, and enjoy!
Search engine optimization by SEO Design Solutions
Recent Comments