What's the default javascript library used in symfony 1.4? - php

I'm reading a tutorial for 1.2,which says prototype is the built in library :
http://www.symfony-project.org/book/1_2/11-Ajax-Integration
What about the newest version of symfony?
I'm only familiar with jQuery,is there an easy way to replace the default by jQuery?

I don't believe there is a default in 1.4, no JS library is bundled with the release. To get jQuery method bindings like you had in 1.2 you can use the sfJqueryReloadedPlugin.

As far as i know, it is still prototype. If you can download it, you can easily check this too. Also see what's new in 1.4, there is no mention of new js library being included.

As far as I know, that built-in support is removed in 1.4 and in any case plugins and stuff aren't up to date for that. You're better off just ignoring it and building what you need yourself.
I'm using Symfony 1.4 very happily with Jquery 1.4. You set the Javascript source you need in the view.yml configuration file of the application or module (using the standard Symfony configuration cascade). And I think you can use a Javascript helper to call a .js file on the fly as well.
It all works fine.

Related

Adding own code into Joomla 3.0

I am pretty new to Joomla and i want to add my own HTML, PHP and Javascript code into my joomla website.
I have been looking at this question:
Custom php code in Joomla page
How ever it seems that the Jumi plugin or extension is only for 1.4 - 1.6 and i'm running joomla 3.0
I was wondering if any of you guys know or use any form of extension to add your own code into your joomla website!?
Not sure where you found 1.4 and 1.6 from, but Jumi is definitely compatible with Joomla 3.x, as you see see in the following link:
http://extensions.joomla.org/extensions/edition/custom-code-in-content/1023
it has the image:
Download and install the extension and don't forget to read the documentation through if you have issues, as most people seem to forget this ;)
if you waht to add code in sens of your articles will contain code ( PHP, javascript & HTML)
then create simple module try to find some module generator on the net then affect that module to a position and load that module in your article like this {loadmodule position}

Using Laravel bundle with CodeIgniter

I want to use Laravel Bootstrapper bundle http://bundles.laravel.com/bundle/bootstrapper with my CodeIgniter application.
How can i utilize autoloader functionality to use Bootstrapper bundle code in CodeIgniter in native PHP 5 fashion.
Button::make('Abc')->with_icon('ok');
Do you suggest to convert Bootstrapper bundle in CodeIgniter library or we can use it as it is.
I am using bootstrap for creating views, thus already including bootstrap specific css, js & images.
Please help, so that the bundle can be used with CodeIgniter
Why? It's not designed to work with CI, you'll probably have to mess about alot to get it working. See one of the many versions available for CI here https://github.com/vesparny/codeigniter-html5boilerplate-twitter-bootstrap.
Further more, I dont see any great advantage of having a bootstrap CI integration, if you do then go for it but I just use my own customised bootstrap and load it in as normal in template/view files. Works just fine and keeps all those UI/view bits and pieces separate for designers/Front-end coders who panic at the sight of php.
All this work trying to keep design, function and layout separate and people go to great effort to ruin it with something like this.

How i can extend the Codeigniter library in Pyrocms

I want to add some more library and helpers file into Pyrocms which is based on codeigniter.Actually i have to add facebook connect and found some good working examples of facebook connect so now i want to implement these codeingiter libraries and other files in Pyrocms.Let let me know where to put these libraries. Your help will be appreciable.
since version 1.3.0 addons/default/libraries
or addons/shared_addons/libraries for the pro version. (This bit will help on the where to put stuff topic...
http://www.pyrocms.com/docs/1.3/manuals/developers/understanding-the-addons-directory )
Then load the lib in your controller, etc as such $this->load->library('cool_facebook_connect_lib');
And, depending on your version you may have to change around a couple lines in MY_loader for it to work, http://www.pyrocms.com/forums/topics/view/18087

Symfony + HTML5Boilerplate integration?

Are there any examples out there on how to integrate HTML5Boilerplate into Symfony? The problem that I'm running into is the way Symfony handles stylesheet and javascript loading.
Symfony likes you to add your stylesheets and javascript to a special object in the controller (or define them in the view.yml) and then your template/view just call <?php include_stylesheets() ?> and <?php include_javascripts() ?>.
The problem is that the HTML5Boilderplate template wants you to load the Modernizr.min.js in the <head> and all the rest of the javascript files at the end of the </body>. Symfony's magic function wants to just load them all at once though. And I can't seem to figure out a way to selectively load them one at a time in the template.
Also, HTML5Boilerplate has CDN jQuery loading with a dynamic local backup load like this:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jqduery.js"></script>
<script>window.jQuery || document.write("<script src='js/backend/libs/jquery-1.5.1.min.js'>\x3C/script>")</script>
Is there anyway to accomplish this in Symfony templates without having to inject the PHP $_SERVER[whatever] into the code?
I feel like I can probably make it all work together but I'm trying to avoid making it too hacky because Symfony uses so many magic methods and voodoo...
Symfony Version
I'm using Symfony 1.4 for this project. The available web host isn't running PHP 5.3.x yet, which is a requirement of Symfony 2.0
If you want to selectively load assets in different locations in the HTML that Symfony 'prefers', you won't be able to use load_javascripts() and load_stylesheets(). I'm not familiar with HTML5Boilerplate, but if you're still using a layout file, why not just manually put the asset includes where you need them to go? This goes against Symfony's way of using view.yml to queue up assets, but sooner or later with any framework you're going to run into cases where you need to do someting your way.
Again, I'm not familiar with HTML5Boilerplate, so if I'm not seeing something, let me know in the comments.
If you are using Symfony 2.0 you should use OryzoneBoilerplateBundle
What version of symfony are you using?
I use html5boilerplate with symfony (2.0) no problem, simply calling the css and javascript straight from a twig template in my resources folder.

Symfony2 standalone form component - setting up a form

I'm trying to implement Symfony2 form builder component as a standalone. The documentation
doesn't really talk about this though, just in relation to using the whole framework.
The standalone is on Github but has no docs.
Ive searched around and seen a few people ask this question but none seems to have any answers.
All I need is a basic guide on how to setup a form , build it, then view it.
Anyone?
Edit: My first response below is now obsolete (and the link does not work anymore). Please refer to
https://github.com/webmozart/standalone-forms for a state-of-the-art solution.
Previous (now obsolete) answer:
I've tried hard and managed to display a form (using PHP engine, not Twig).
Indeed you need a few components: Form, but also ClassLoader, EventDispatcher, Templating (for rendering) and Translation (for rendering labels). You will also need some resources from the FrameworkBundle bundle (mainly templates).
More info on this:
http://forum.symfony-project.org/viewtopic.php?f=23&t=36412
And my mini-tutorial:
http://n.clavaud.free.fr/blog/index.php?article31/symfony2-standalone-form-component-tutorial
First, copy Form Component to your project to directory which contains third-party libraries (not only Symfony components, but also ORM or whatever), let's say lib/, so it's in <project_path>/lib/Symfony/Component/Forms.
Then you have to auoload it - either manually or using any PSR-0 compatible class loader i.e. SplClassLoader or Symfony's UniversalClassLoader (there is chapter in docs and in quick tour about this). Example:
$loader = new UniversalClassLoader();
$loader->registerNamespace('Symfony', __DIR__.'/lib');
$loader->register();
Using Form Component isn't in fact strongly documented, but in Symfony Book there are few examples how to use Form classes about this component, so I guess you'll have to dive into sources, beginning with Form class (maybe later you'll give some feedback about experiences somewhere in the Web?).
Since Symfony 2.1, the form component has been using composer.
You can locate the composer.json file inside the repository. It contains a dependency map that can be used to get the dependencies installed.
You can do so by simply running composer install from inside your console.
P.S I know this thread is old. The information I'm contributing apply to any new users that may need it.
First of all not with Symfony2. But creating form with Aura.Input and some view helpers of Aura.View makes it easy to bring Standalone Forms and Validation.
If you are interested you can read it over http://harikt.com/phpform/ , and source is in github.
/*
* This file is part of the Symfony package.....
what i understand from that line is that the file is a PART of the framework, can't be removed, can't be ripped, and it won't function if you rip it off the package because it requires other related files in the framework
however, there is an option, and it is to investigate the files and see what functions they call and what variables they use ,redefine them, and use it as standalone IF the license allows you to

Categories