Jump to content
Killersites Forums

U4EA

New Members
  • Content Count

    1
  • Joined

  • Last visited

Posts posted by U4EA

  1. Hi,

     

    It's my first post here.

     

    I consider myself pretty IT savvy, having studied various technologies such as advanced MS Office/VBA, PHP/SQL, JS/jQuery, (X)HTML/CSS etc. I have developed websites before but I am currently in the process of learning ZEND as I am trying to build 2 small scale commercial websites and also an enterprise level website for a company I am starting. ZEND is coming to be slowly but surely, but I am also at times finding it hard to get answers to certain questions.

     

    Before I start asking questions, I should state I am working with ZEND V1.12 and using NetBeans as the IDE.

     

    So, here goes the first of that is sure to be many questions...

     

    I am using a jQuery slider on the index page on one of the new sites I am building. The slider works by hard coding the done with the slider image URLs inside a container div. I have built a custom function that takes 2 parameters - a path to the folder containing the images, and the required file extension. As an example: -

     

    <?php
    function galGetTopPhotos($path, $ext) {
    
    	//Get array of files
    	$images = glob($path . "*.$ext");
    
    	sort($images);
    
    	//Create HTML marked array of images
    	$html_string = "";
    
    	foreach($images as $image)
    	{
    		$html_string .= '<img src="'.$image.'" />';
    	}
    
    	return $html_string;
    
    }
    
    $img_html = galGetTopPhotos('slider/images/', 'jpg');
    
    
    ?>
    

     

    Edit: I accidently posted the original thread at this point without completing it. So I will complete it below...

     

    Before I begin to talk about how to include a function like this in the controller, can I ask the best practice for including the custom function script itself within a ZEND application? I would assume it would reside in library/functions. Aside from that, how should it be included? In application.ini?

     

    Many thanks!

     

    Edit:

     

    Should this be a helper class?

×
×
  • Create New...