Call a php file from an action in zend framework - php

I have a requirement.In my indexAction() I want to call a php file e.g. verify.php. How can I do this? Do I need any changes in my application.ini file.
Please respond immediately.Thanks in advance.

In your action:
$this->_helper->redirector->gotoUrlAndExit('/mst/verify.php');

If your file exist e.g. '/mst/verify.php' then you have to do as #David Weinraub said.
But if it is virtual - you have to write own router in a bootstrap file for example and do as #David Weinraub said again.

First of all you should make a model, in the index method you make an instance of that object and call a defined method...

Related

Kohana 3.2 not working Form helper

I have some code, where is used Form helper. All worked well. Now I have error
Call to undefined method Form::open()
When I check SYSPATH exist classes Form and Kohana_Form
This situation is in each file where is used this helper.
This is kohana 3.2. In this files was not any changes. I tried it on PHP 5.4 and PHP 5.5
Any idea why? Thanks in advance for help.
The most likely thing is that you have a Form.php somewhere that's overriding the SYSTEM Form.php. To find out if this is happening, use the Kohana::find_file() function like this:
Kohana::find_file('classes', 'form');
The output from this should tell you the path of the Form.php that's being used when you call the Form class. Check if it's the one in the SYSTEM folder.

Laravel possible to route to a single php file?

I have am using Laravel and I am trying to call a single php file via the browser, which is
located in my app path.
I have setup a Route::get to a function HomeController#index
function index(){
include(app_path().'/myphpfile.php');
}
And gets called when doing http://localhost:8888/home/index
This is how I call it atm.
The Problem is my file accepts furthe parameters, which are
processed inside my php file like:
http://localhost:8888/myphpfile.php/user/hello1
or
http://localhost:8888/myphpfile.php/user/hello1/default
So I tried to use Route::any.
It is not working. Can I somehow just tell Laravel to pick up the php file like I mentioned above? Other way then using include?
I donĀ“t want to put this file into the public folder.
Something like wildcard routing.
Thank you for your help.

change configure variable dynamically cakephp

Let's say I have this in my bootstrap.php file in a cakePHP application:
Configure::write('Config.language', 'eng');
How can I dynamically change the value of that configuration variable based on user action in a controller of my application? I tried to do the same thing that I did above here in my controller, but that didn't work
Any help?
Try Configure::write('Config.language', 'dut'); for e.g.
This answer from the question suggested by #Ryan Pendleton shows a somewhat correct way to use this directive.
It should be used in the AppController because it gets loaded first - as the parent of all other controllers in the application itself.
I used "somewhat correct" because it is best to validate the language codes ('eng', 'fre', 'dut') in the app/config/routes.php file - go here for more information.
Also do check out this: Internationalization-Localization explanation.

Symfony subdirectory lib/form/<new_directory>

I am going to program a website in symfony 1.4. It is working very fine. But I have on question.
How can access to a subfolder in lib/forms/
Example:
I have an accountForm.php in
/lib/forms/account/accountForm.php
How can I get to this in the template and in action, when my module is called "account".
I can include the accountForm.php pretty good, when I am putting it in
/lib/forms/accountForms.php
But I want it the other way to have more overview. Can somebody help me?
Well part of the issues is probably that you havent named the file properly... it should be AccountForm.class.php if it is an actual form class. As long as it is named that way it should autoload just fine. Just make sure you clear cache after you have added a new file.
If its not a class then it doesnt belong in a lib directory. That exactly is in accountForm.php?
You might also want to customize you autoloading configuration if you are sure of what youre doing: http://www.symfony-project.org/reference/1_4/en/14-Other-Configuration-Files
I'm not sure but try adding the form's path to autoload.yml
yourProject/config/autoload.yml
use %SF_MODEL_LIB_DIR%/forms if the form is in lib/model/forms
or %SF_LIB_DIR%/forms if the form is in lib/forms
autoload:
customForm:
name: yourForm
path: %SF_MODEL_LIB_DIR%/forms/accounts/
recursive: on
Name the account form accountForm.class.php and then in your action you can just do:
$this->form = new accountForm();
and in your template:
echo $form;

How to Extend a Helper in CodeIgniter?

I want to add some new functions to the core string helper, which is found in system/helpers folder. I think there was a 'right' way to do this using MY_String_helper, or something of that sort. I can't remember exactly how it was done though. Any thoughts on this issue?
I found it. Make a file with a name such as this, in the application/helpers directory:
MY_xx_helper.php
E.g:
MY_string_helper.php
Then you can call
$this->load->helper('string');
And it should load all the existing helper functions as well as the new ones you add.
Doing that you can not only add new functions but replace exising helper functions.
For a primary source, in case things change in the future, the CodeIgniter User Guide's Helpers page has a section describing how to extend helpers.

Categories