I tried to put this code on my partial too:

<?php
use_helper('Asset');
foreach ($form->getJavascripts() as $js ){
  use_javascript($js);
}
foreach ($form->getStylesheets() as $css ){
  use_stylesheet($css);
}
?>

didn't work.....



On Thu, Dec 10, 2009 at 6:17 PM, Nei Rauni Santos <nra...@gmail.com> wrote:

>
> If I add this line on layout.php
>
>
> <?php
> var_dump( sfContext::getInstance()->getResponse()->getStylesheets() );
> ?>
>
> I get the dump:
>
> *array*
>
>   'frontend/frontend' =>
>     *array*
>       *empty*
>   'frontend/frontend-print' =>
>     *array*
>
>
>       'media' => string 'print' *(length=5)*
>   'frontend/frontend-handheld' =>
>
>
>     *array*
>       'media' => string 'handheld' *(length=8)*
>   'frontend/frontend-iphone' =>
>
>
>     *array*
>       'media' => string 'only screen and (max-device-width: 480px)' 
> *(length=41)*
>
> If I put the same code inside my partial It show one more css included by 
> partial.
>
>
> *array*
>   'frontend/frontend' =>
>     *array*
>       *empty*
>   'frontend/frontend-print' =>
>
>
>     *array*
>       'media' => string 'print' *(length=5)*
>   'frontend/frontend-handheld' =>
>
>
>     *array*
>       'media' => string 'handheld' *(length=8)*
>   'frontend/frontend-iphone' =>
>
>
>     *array*
>       'media' => string 'only screen and (max-device-width: 480px)' 
> *(length=41)*
>   'autosuggest/autocomplete' =>
>
>     *array*
>       'media' => string 'all' *(length=3)*
>
>
> my partial code:
>
>
> <?php use_stylesheets_for_form($form) ?>
> <?php use_javascripts_for_form($form) ?>
>
> <pre>
> <?php
> var_dump( sfContext::getInstance()->getResponse()->getStylesheets() );
> ?>
> </pre>
>
> <div id="searchboxleft" class="block">
> ...................................
>
>
> I think that it's a but..
>
> Nei
>
>
>
>
>
> On Thu, Dec 10, 2009 at 5:31 PM, Nei Rauni Santos <nra...@gmail.com>wrote:
>
>> I notice that this way was wrong, and on my widget I put thow 2 methods:;
>>
>>   /**
>>    * Gets the stylesheet paths associated with the widget.
>>    *
>>    * @return array An array of stylesheet paths
>>    */
>>   public function getStylesheets()
>>   {
>>     return array('/sfFormExtraPlugin/css/jquery.autocompleter.css' =>
>> 'all');
>>   }
>>
>>   /**
>>    * Gets the JavaScript paths associated with the widget.
>>    *
>>    * @return array An array of JavaScript paths
>>    */
>>   public function getJavascripts()
>>   {
>>     return array('/sfFormExtraPlugin/js/jquery.autocompleter.js');
>>   }
>>
>>
>> but It didn't work yet...
>>
>> If I put these  lines on partial symfony print the <script> tag on middle
>> of my template...
>>
>> <?php include_stylesheets_for_form($form) ?>
>> <?php include_javascripts_for_form($form) ?>
>>
>>
>> how to fix it??
>>
>>
>> Nei
>>
>>
>>
>> On Thu, Dec 10, 2009 at 5:17 PM, Nei Rauni Santos <nra...@gmail.com>wrote:
>>
>>> Guys,
>>>
>>> I've upgraded my symfony from 1.2 to 1.3 and some javscripts added by
>>> widgets are not included...
>>>
>>>
>>>  */
>>> class mpWidgetFormInputAutoSuggest extends sfWidgetForm
>>> {
>>>     ......
>>>     // javascripts
>>>
>>> sfContext::getInstance()->getResponse()->addJavascript("prototype/js/prototype");
>>>
>>> sfContext::getInstance()->getResponse()->addJavascript("autosuggest/autocomplete");
>>>
>>> sfContext::getInstance()->getResponse()->addStylesheet("autosuggest/autocomplete");
>>>
>>>
>>> on layouts I'm printing
>>>
>>> <?php include_javascripts() ?>
>>> <?php include_stylesheets() ?>
>>>
>>>
>>> but not worked..
>>>
>>> Any idea??
>>>
>>> Nei
>>>
>>>
>>> --
>>> Nei Rauni Santos
>>> nra...@gmail.com
>>> +55 41 85020985
>>>
>>
>>
>>
>> --
>> Nei Rauni Santos
>> nra...@gmail.com
>> +55 41 85020985
>>
>
>
>
> --
> Nei Rauni Santos
> nra...@gmail.com
> +55 41 85020985
>



-- 
Nei Rauni Santos
nra...@gmail.com
+55 41 85020985

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.


Reply via email to