Forum

Thread tagged as: Question, Configuration, Feathers

Feathers in Perch 3

Is there going to be updated documentation on feathers in Perch 3? I went to try them on a current Runway build using P3 but noticed it appears Feathers is now a core part of Perch - or at least it appears that way. The way I have it working at the moment is in the feathers.php - within the config dir - I have:

<?php
    PerchSystem::register_feather('Wings');

    class PerchFeather_Wings extends PerchFeather
    {
        public function get_css($opts, $index, $count)
        {   
            $out = array();

            if ( null !== getenv("DEVELOPER_ENV") && getenv("DEVELOPER_ENV") == 'development') {

                $out[] = $this->_single_tag('link', array(
                    'rel'=>'stylesheet',
                    'href'=>'/dist/css/build.css',
                    'type'=>'text/css'
                ));

            } else {
                $CSSversion = filemtime($_SERVER['DOCUMENT_ROOT'].'/dist/css/build.min.css');

                $out[] = $this->_single_tag('link', array(
                    'rel'=>'stylesheet',
                    'href'=>'/dist/css/build.min.'.$CSSversion.'.css',
                    'type'=>'text/css'
                ));
            }

            return implode("\n\t", $out)."\n";
        }
}
?>

This then generates my feather fine, although I'm unsure if this is how it's intended to be used as I know usually feathers live within their own directory. I just want to be sure I'm on the right track.

Mathew Doidge

Mathew Doidge 2 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

The perch/config/feathers.php file is used to include your feather.

Your feather itself goes in perch/addons/feathers

That's not changed in Perch 3. The only difference in Perch 3 is that feathers aren't enabled by default.

Thanks Drew