Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ccdn Component Common Bundle Laravel Package

codeconsortium/ccdn-component-common-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the bundle to your composer.json:

    composer require codeconsortium/ccdn-component-common-bundle
    

    Register the bundle in app/AppKernel.php:

    new CodeConsortium\CCDNComponentCommonBundle\CCDNComponentCommonBundle(),
    
  2. First Use Case The bundle provides foundational assets (CSS, JS, sprites) for other CCDN bundles. Use it as a dependency for any CCDN-related bundle in your project. Example:

    # app/config/config.yml
    imports:
        - { resource: "@CCDNComponentCommonBundle/Resources/config/config.yml" }
    
  3. Where to Look First

    • Assets: Check Resources/public/ for CSS/JS/sprites.
    • Configuration: Review Resources/config/config.yml for default settings.
    • Dependencies: Ensure other CCDN bundles (e.g., CCDNSandBox) are installed.

Implementation Patterns

Workflows

  1. Asset Integration Extend the bundle’s assets in your theme by overriding its templates or assets:

    {% block ccdn_stylesheets %}
        {{ parent() }}
        {{ asset('bundles/ccdncomponentcommon/css/your-extensions.css') }}
    {% endblock %}
    
  2. Configuration Overrides Customize default settings via config.yml:

    ccdn_component_common:
        sprite_path: "%kernel.root_dir%/../web/sprites/custom"
        enabled: true
    
  3. Dependency Injection Use the bundle’s services (if any) in your controllers:

    class MyController extends Controller {
        public function indexAction() {
            $assetHelper = $this->get('ccdn.component.common.asset_helper');
            return $this->render('...', ['assets' => $assetHelper->getAssets()]);
        }
    }
    
  4. Sandbox Integration For development, pair with CCDNSandBox:

    composer require codeconsortium/ccdn-sandbox-bundle
    

Integration Tips

  • Asset Pipeline: Use Symfony’s asset system (%kernel.root_dir%/../web) to serve static files.
  • Theme Inheritance: Extend the bundle’s Twig templates (e.g., base.html.twig) in your theme.
  • Bootstrap Compatibility: Leverage the included Glyphicons/Twitter Bootstrap assets for UI consistency.

Gotchas and Tips

Pitfalls

  1. Symfony 2.4/PHP 5.4 Dependency

    • Issue: The bundle requires Symfony 2.4 and PHP 5.4, which may conflict with modern Laravel (or Symfony 4+/5+) projects.
    • Fix: Use a legacy environment or fork the bundle for compatibility.
  2. Asset Paths

    • Issue: Hardcoded paths (e.g., Resources/public/) may break in custom setups.
    • Fix: Override paths in config.yml or extend the bundle’s asset loader.
  3. Lack of Documentation

    • Issue: Minimal README and no clear API for services/classes.
    • Fix: Inspect CCDNComponentCommonBundle.php and Resources/config/ for clues.
  4. No Active Maintenance

    • Issue: Last update in 2013; no Laravel/Symfony 5+ support.
    • Fix: Treat as a static asset library; avoid relying on undocumented features.

Debugging

  • Asset Loading Failures: Clear cache (php app/console cache:clear) and check app/logs/dev.log.
  • Twig Errors: Ensure templates extend CCDNComponentCommonBundle::base.html.twig correctly.

Extension Points

  1. Custom Assets Override the Resources/public/ directory in your theme:

    mkdir -p web/bundles/ccdncomponentcommon/css
    cp vendor/codeconsortium/ccdn-component-common-bundle/Resources/public/css/* web/bundles/ccdncomponentcommon/css/
    
  2. Service Extensions If the bundle provides services, extend them via DI:

    services:
        my.custom.asset_helper:
            class: My\Custom\AssetHelper
            arguments: ["@ccdn.component.common.asset_helper"]
    
  3. Event Listeners Hook into the bundle’s events (if any) via services.yml:

    services:
        my.event_listener:
            class: My\EventListener
            tags:
                - { name: kernel.event_listener, event: ccdn.component.common.event, method: onEvent }
    

Tips

  • Use for Legacy Projects: Ideal for maintaining old Symfony 2.4 apps tied to CCDN.
  • Static Asset Reference: Treat it as a library of pre-built assets (CSS/JS/sprites) rather than a dynamic framework.
  • Fork and Modernize: If critical, fork the repo and update dependencies for Symfony 5+/Laravel.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge