Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets Manager hard reference to \Phalcon\Tag, should use DI #12261

Closed
kristofferingemansson opened this issue Sep 28, 2016 · 2 comments

Comments

Projects
4 participants
@kristofferingemansson
Copy link
Contributor

commented Sep 28, 2016

Assets Manager has hard reference to \Phalcon\Tag when generating HTML.
Assets Manager should fetch tag instance from dependency injector instead to allow custom behavior.

class MyTag extends \Phalcon\Tag
{
    public static function stylesheetLink($parameters = null, $local = true)
    {
        die('bar');
    }
}

$di = new \Phalcon\Di\FactoryDefault();
$di->setShared('tag', MyTag::class);

/** @var \Phalcon\Assets\Manager $manager */
$manager = $di->get('assets');
$manager->addCss('test.css');
$manager->outputCss();

Actual

<link rel="stylesheet" type="text/css" href="/test.css" />

Expected

bar

https://github.com/phalcon/cphalcon/blob/v3.0.1/phalcon/assets/manager.zep#L775
https://github.com/phalcon/cphalcon/blob/v3.0.1/phalcon/assets/manager.zep#L811 (same for JavaScript)

Details

  • Phalcon version: 3.0.1
  • PHP Version: 5.5.24
  • Operating System: Windows 7
  • Installation type: xampp

@sergeyklay sergeyklay added this to the 3.1.0 milestone Dec 19, 2016

@Jurigag

This comment has been minimized.

Copy link
Member

commented Feb 1, 2017

If it's 3.1.0 then if service called tag doesn't exist it should still use Tag class in static way.

@sergeyklay sergeyklay modified the milestones: 3.1.0, 3.2.0 Mar 2, 2017

@sergeyklay sergeyklay modified the milestones: 3.2.0, 4.0.0 Jun 18, 2017

@stale stale bot added the stale label Apr 16, 2018

@sergeyklay sergeyklay closed this Apr 16, 2018

@sergeyklay sergeyklay reopened this May 2, 2018

@stale stale bot removed the stale label May 2, 2018

@phalcon phalcon deleted a comment from stale bot Dec 22, 2018

@niden niden added this to To do in 4.0 Release via automation Feb 21, 2019

@niden niden moved this from To do to In progress in 4.0 Release Mar 12, 2019

@niden

This comment has been minimized.

Copy link
Member

commented Mar 12, 2019

Implemented

@niden niden closed this Mar 12, 2019

4.0 Release automation moved this from In progress to Done Mar 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.