• PHP
  • Ruby on Rails
  • MySQL
  • Linux
    • SELINUX
    • Fedora
    • debian
  • Apache
  • nginx
  • AJAX
Albertech.net

Category Archives: Frameworks

Zend Form – Adding a checkbox element with label to the side

February 21, 2013 7:42 pm / Albertech.net

Here’s the fastest way to add a checkbox element with a label to the side of it (inline) using the Zend Framework. By default, the checkbox is put on a separate line after the label,which isn’t a standard practice. This can be done using some CSS and a Zend Decorator element.

CSS Code:

label.inline {
display: inline;

}
.inlinecheck{
clear: both;
float: left;
width: 25px;
margin-bottom: 0;
}

Zend PHP Code:

$this->addElement('checkbox', 'mycheckbox', array(
'label' => 'My Label',
'name' => 'mycheckbox',
));
$this->getElement('mycheckbox')->addDecorator('Label', array('placement' => 'APPEND'));
$this->getElement('mycheckbox')->addDecorator('HtmlTag', array('tag' => 'dl','class' => 'inlinecheck'));

Rename mycheckbox with the name of your element and set the label accordingly.

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Frameworks, PHP / Tagged: checkbox, zend

Drupal 7 Released with new admin features

January 6, 2011 12:24 pm / Albertech.net

Drupal 7 has been released. There are a number of improvements to the system with this release including a new administrative interface, built-in custom content structure (it was a previously a plug-in), improved performance, and an automated testing framework built-in.

For more information, visit the Drupal website: http://drupal.org/drupal-7.0

There are also Drupal release parties on January 7, 2011. http://www.drupal7releaseparty.org/

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Frameworks, PHP

CodeIgniter 1.7.2 Security Patch

August 14, 2010 1:33 am / Albertech.net

If you are running CodeIgniter 1.7.2, there is a security flaw with the file upload class. (fixed on July 12, 2010)  The easiest way to install the patch is to use the standalone patch http://codeigniter.com/download_files/CI_1.7.2_201007_sec_patch.zip and unzip the file to the Code Igniter system/libraries folder.

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Frameworks, PHP / Tagged: codeigniter, security

CodeIgniter: Reading Excel Files

April 20, 2010 3:06 pm / Albertech.net

Reading Excel files in CodeIgniter is actually very easy once you have the right documentation. The first thing you will need to do is utilize the CodeIgniter “Upload” library and add in the Excel Reader library for reading the files. The documentation on the CodeIgniter website in regards to this Excel Reader library is missing some details in implementation. This tutorial will go through the steps of installing the Excel reader library and getting an example implementation working.

Step 1: Download the Excel Reader Library from CodeIgniter’s website.
http://codeigniter.com/wiki/Excel_Reader_Class/

Copy and paste the Excel_reader.php section into notepad or a text editor. Save the file in [CodeIgniter Folder]/system/application/libraries/ as Excel_reader.php

Step 2: Load the Library from your CodeIgniter Application
$this->load->library('excel_reader');

Step 3: Set the load path of the Excel file that has been uploaded
For example:
$uploadpath = "/var/www/uploads/test.xls";

Step 4: Run the Excel Reader Library
$this->excel_reader->read($uploadpath);
// Read the first workbook in the file
$worksheetrows =$this->excel_reader->worksheets[0];

Step 5: Set number of columns in your Excel file
$worksheetcolumns = 5;

Step 6: Run through the table and output the data
I’ve created a quick function that will go through the entire worksheet and output the data for testing.

echo "<table>";
foreach($worksheetrows as $worksheetrow)
{
      echo "<tr>";
     for($i=0; $i<worksheetcolumns; $i++)
    {
           // if the field is not blank -- otherwise CI will throw warnings
           if (isset($worksheetrow[$i]))
                 echo "<td>".$worksheetrow[$i]."</td>";
           // empty field
           else
                 echo "<td>&nbsp; </td>";
     }
     echo "</tr>";
} 
echo "</table>";

This should get you going with reading Excel files in CodeIgniter.

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Frameworks, PHP / Tagged: codeigniter excel

CakePHP Resources

January 6, 2010 2:29 pm / Albertech.net

I’ve been noticing that a lot of documentation in CakePHP seems to be spread out onto many different sites. In my opinion, the CakePHP manual isn’t comprehensive enough for learning.

Here’s a list of useful CakePHP resources I’ve used recently:

CakeForge – Great resource for Open Source CakePHP applications. This site has many more applications than the CakePHP Bakery.
http://cakeforge.org/

Bakery – How to use different CSS files in CakePHP
http://bakery.cakephp.org/articles/view/some-ideas-to-organize-your-css-files-and-autoload-them-in-cakephp

Giga Promoters – CakePHP tutorials and scripts:
http://www.gigapromoters.com/blog/category/cakephp/

I’ll be updating this list as I find more resources.

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Frameworks, PHP / Tagged: CakePHP, examples, tutorials

Post Navigation

← Older Posts
 

Categories

  • AJAX
  • Android
  • Apache
  • Canon Cameras
  • Cloud
  • CMS
  • Computer Mods
  • Conferences
  • Deals
  • debian
  • Fedora
  • Flash
  • Frameworks
  • git
  • Hardware
  • HTML
  • IDE
  • iPhone
  • iPhone App Review
  • jQuery
  • Linux
  • Mac OS X
  • MySQL
  • nginx
  • PHP
  • portfolio
  • Puppet
  • Ruby on Rails
  • Script Reviews
  • SELINUX
  • Software
  • Software Review
  • SQL Server
  • statistics
  • Tech
  • Tomcat
  • Uncategorized
  • VMWARE
  • VPS
  • Windows
  • wordpress
  • Zend Framework

Blogroll

  • DragonAl Flickr
  • Dropbox – Free 2GB Account
  • James' Blog
  • Javascript Compressor
  • PHP Builder Community
  • PHP-Princess.net
  • Rubular – Regular Expression Validator
  • The Scale-Out Blog
  • Tiny MCE

Tags

activation AJAX android antec Apache AWS awstats canon coda codeigniter debian enclosure external free G1 install vmware tools Internet Explorer iphone 5 jquery Linux mx-1 MySQL office 2007 OSX photoshop PHP plugin plugins portfolio redesigned website review rewrite script security SELinux ssh tinymce tutorial upgrade VMWARE vmware server wordpress wordpress mu XSS zend framework
© Copyright 2013 Albertech.net
Infinity Theme by DesignCoral / WordPress
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.