Coder Social home page Coder Social logo

alpixelseobundle's People

Contributors

alexbdev avatar benjamin-hubert avatar

Watchers

 avatar  avatar  avatar

Forkers

firestorm23

alpixelseobundle's Issues

MetaTagService weird work

Hi, I installed your bundle. Generation of Sonata SEO tags seems not working due to this code.

public function onControllerFound(FilterControllerEvent $event)
    {
        if (!is_array($controllerData = $event->getController())) {
            return;
        }

        $controllerData = $event->getController();

        if ($controllerData[0] === null) {
            return;
        }

        $method = new \ReflectionMethod($controllerData[0], $controllerData[1]);

        //First we check for an automatic optim
        $annotations = $this->annotationReader->getMethodAnnotations($method);

        if (!empty($annotations)) {
            foreach ($annotations as $annotation) {
                if ($annotation instanceof SEOAnnotation\MetaTag) {
                    $request = $controllerData[0]->getRequest();
                    $controller = $request->get('_controller');
                    $object = $request->get($annotation->value);

                    if (empty($object)) {
                        continue;
                    }

                    $class = new \ReflectionClass($object);

That's Alpixel\Bundle\SEOBundle\Service\MetaTagService on 30-58. The code i'm intetersted is 52-56 line

                    $object = $request->get($annotation->value);

                    if (empty($object)) {
                        continue;
                    } 

                    $class = new \ReflectionClass($object);

This code should get an instance of class to pass it to the repository finder. First I don't get what is

$annotation->value

In annotation this parameter does not have a name and your README does not say what it is
So this parameter should be in request and this is the weirdest thing. In my articleAction in which use your bundle, request only contains slug as input parameter from the router. But your code says that Request should containt entity instance to get it's class and pass it to the repository finder. So I don't get why you use

$annotation->value

instead of just

$annotaion->providerClass

to find right SEO tags pattern. And further and I don't get what is the purpose of $annotation->value parameter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.