Fork me on GitHub

Other articles


  1. CakePHP Getting Tree Path

    In a reversal of yesterday's post is today's, getting a path to a node, or nodes. Basically we just use the core getpath() function of the Tree behavior and traverse that path.

    function setTreePath(&$data, $path='tree_path', $label='name') {
        if (!is_array($data) || !in_array('Tree', $this->actsAs)) {
            return $data ...
    read more

    There are comments.

  2. CakePHP Lightbox Helper

    Made a helper to output lightbox compatible links, since the core HTML helper was not working. Stick the following code in app/view/helpers/lightbox.php:

    class LightboxHelper extends AppHelper {
    
        var $helpers = array('Html');
    
        function img($thumb, $full, $imgAttributes = array(), $linkAttributes = array()) {
            $defaultLinkAttributes = array('rel'=>'lightbox');
            $linkAttributes = array_merge($defaultLinkAttributes, $linkAttributes ...
    read more

    There are comments.

  3. CakePHP Tree Find By Path

    Wrote these little functions to help with finding tree nodes by specifying a path of values. For example if we had a tree of categories with similar names like TVs->Color and Movies->Color, we can't find by the category name since its not unique, but we can search ...

    read more

    There are comments.

  4. Page 1 / 8 »

blogroll

social