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

Missing support for importing namespaces in PhpFile #38

Closed
Nazariy opened this issue Oct 15, 2018 · 3 comments
Closed

Missing support for importing namespaces in PhpFile #38

Nazariy opened this issue Oct 15, 2018 · 3 comments

Comments

@Nazariy
Copy link

@Nazariy Nazariy commented Oct 15, 2018

Seems like it's not possible to import namespaces via Nette\PhpGenerator\PhpFile for example:

<?php
use My\Full\Classname as Another, My\Full\NSname;

$obj = new Another; // instantiates object of class My\Full\Classname
NSname\subns\func(); // calls function My\Full\NSname\subns\func
?>

http://php.net/manual/en/language.namespaces.importing.php

Currently it's only possible via PhpNamespace class

@duxthefux

This comment has been minimized.

Copy link

@duxthefux duxthefux commented Nov 22, 2018

Jep seems like.

+1 for that

@JanTvrdik

This comment has been minimized.

Copy link
Contributor

@JanTvrdik JanTvrdik commented Nov 22, 2018

Can't use just use PhpNamespace with empty namespace?

@duxthefux

This comment has been minimized.

Copy link

@duxthefux duxthefux commented Nov 25, 2018

can you give an example? @JanTvrdik

@dg dg closed this in 9de4e09 Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.