Month: August 2008

CakePHP : Change view file from controller

With CakePHP, the controller core automatically detects the file name of the view file which needs to be rendered from a controller action. You might want to reuse an existent view for an action or specify a different file name. For example, if you have a controller named “Users” and you execute a controller action named “profile”, the view file “users/profile.ctp” will be automatically rendered. But you might want to output a view file named “edit.ctp” in the “users” folder. You can do this with the render method. $this -> render('edit'); The code above will automatically render the “users/edit.ctp” view file after the controller action/method has been executed. But say for example that your “edit.ctp” file is not within the “users” folder, but rather inside a folder named “accounts”. Then you can change the viewPath and then execute the render method. $this -> viewPath = 'accounts'; $this -> render('edit'); So the code above will output the “accounts/edit.ctp” view...

Read More Stats Stopped Working

I recently integrated a blog and documentation base into the website and noticed after a few days that my stats stopped working completely after switching the theme. I’ve been puzzled about this for a few days now and managed to figure out that, out of idiocy, I completely forgot to call the wp_footer function in the footer.php file of my custom theme. If you recently changed your WordPress theme and noticed that your stats stopped working, ensure that the wp_footer function is called in your footer file, just before the BODY tag. See the example below : <?php wp_footer(); ?> </body> Best of...

Read More

WordPress Shopping Cart Plugin

The WordPress Shopping Cart plugin gives you the ability to quickly and seamlessly integrate an online shop with a fully functional shopping cart interface into any WordPress website. With the easy to use interface, you can set up your multiple products and categorize/organize them into multiple product categories. Add additional images to showcase your products so that users know what they are buying and add digital downloads to products if needed so that users can securely download paid files from your website. Multiple payment methods, including PayPal, 2CheckOut and MoneyBookers give your users the ability to choose how they would like to pay and process their payments without any fuss at all. In just a few minutes with a few clicks, your users will be back at your site with a completed...

Read More

PHP: Increase memory limit

Have you ever received a fatal error on your server similar to the one below when you tried to execute a script? The fatal error shown below, indicates that your PHP configuration has a memory limit set and the script which you are executing is trying to allocate more memory than what is available for use. Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 8192 bytes) in /var/www/vhosts/ on line 23 There is a solution to this though. You can increase the memory limit of your PHP configuration. There are two approaches though. One which is for shared hosting customers without shell or php.ini configuration file access and the second approach is for VPS or dedicated server customers who have the ability to edit their PHP configuration file. Shared Hosting Shared hosting customers need to insert a command into a .htaccess file, telling your web server that a PHP configuration value needs to be modified when PHP is loaded. Place this .htaccess file into the root directory of the specified domain. If you already have a .htaccess file, you can open it and place the command below the existent content of the file. Here is the command : php_value memory_limit 64M The command above will change your PHP memory limit configuration value to 64 megabytes of RAM available of PHP scripts being executed on that...

Read More

Stay up to date

Get one email per month with latest news. You can unsubscribe at any time

Fill in a valid email


Pin It on Pinterest

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!