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

Go to widgets using alias #21

Closed
maxlapko opened this issue Apr 4, 2013 · 8 comments
Closed

Go to widgets using alias #21

maxlapko opened this issue Apr 4, 2013 · 8 comments

Comments

@maxlapko
Copy link

maxlapko commented Apr 4, 2013

I'm using $this->widget('ext.widgets.MyWidget') - works fine.
If I use only class and it is correct $this->widget('MyOtherWidget') - does not work.

Also, what about go to view function if we use (not works):
$this->renderPartial('/users/blabla')
$this->beginContent('//layouts/column2')

Thanks.

@junichi11
Copy link
Member

$this->widget('MyOtherWidget')

Where is correct place?

Also, what about go to view function if we use (not works):
$this->renderPartial('/users/blabla')
$this->beginContent('//layouts/column2')

These case are not implemented yet.

Thanks.

@maxlapko
Copy link
Author

maxlapko commented Apr 4, 2013

Where is correct place?

it is not alias, it is only Class name declaration. I think it is similar with go to Class (netbeans function).

Thanks.

@junichi11
Copy link
Member

I know that it is class name.
I think that the class place is within YiiRoot/framework/web/widgets/ .
Is this right?

Thanks.

@maxlapko
Copy link
Author

maxlapko commented Apr 4, 2013

No, it is not necessary. The class can be located anywhere.
for example we can define:
// config/main.php
'import' => array(
'ext.widgets.', // Widget1.php, Widget2.php
'application.otherwidgets.
', // Widget3.php, Widget4.php
)
And we can use $this->widget('Widget1'), ..., $this->widget('Widget3')

Thanks

@junichi11
Copy link
Member

I see.
Thanks for your answer!

@junichi11
Copy link
Member

I have added.
@maxlapko
Could you try to test this?

download

https://bitbucket.org/junichi11/nb-yii-plugin/downloads
org-nbphpcouncil-modules-php-yii-0.3.8.2-for-testing-issue21.nbm

version for adding

0.3.9

notice

Automatically file creation is valid only render or renderPartial method.

Thanks.

@maxlapko
Copy link
Author

maxlapko commented Apr 8, 2013

a lot of thanks. It is fantastic. Works fine.

junichi11 added a commit that referenced this issue Apr 8, 2013
@junichi11
Copy link
Member

Thanks for your confirmation :)

description

Support for the followigns:

  • class name
  • path that starts with '/'
  • path that starts with '//'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants