Search Results

Search found 43 results on 2 pages for 'indexcontroller'.

Page 2/2 | < Previous Page | 1 2 

  • PHP/Zend: How to force browsers to don't show warnings on webpage for a particular case?

    - by NAVEED
    I trying to get twitter updates like this: try { $doc = new DOMDocument(); $doc->load('http://twitter.com/statuses/user_timeline/1234567890.rss'); $isOK = true; } catch( Zend_Exception $e ) { $isOK = false; } If there is not problem with internet connection then $isOK = true; is set. But if there is a problem in loading twitter page then it shows following warnings and does not set $isOK = false; Warning: DOMDocument::load(http://twitter.com/statuses/user_timeline/1234567890.rss) [domdocument.load]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/vcred/application/controllers/IndexController.php on line 120 I don't want to see above warning on my webpage in any case. Any idea? Thanks

    Read the article

  • Zend not autoloading models

    - by Guy
    Ok, this is driving me nuts! I have a directory structure as follows: application - modules -- default --- controllers --- models ---- DbTable ---- Cachmapper.php --- views My config file looks like this [production] phpSettings.display_startup_errors = 0 phpSettings.display_errors = 0 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" resources.modules[] = The application seems to work, if I navigate to localhost, it correctly goes to the index controller. But, for some reason it refuses to load any models. Fatal error: Class 'Model_Cachmapper' not found in .............................../application/modules/default/controllers/IndexController.php on line 26 Ideas? Thanks

    Read the article

  • How do I move Zend Framework From Development to Production?

    - by dirtylogic
    I'm just wondering if anyone else has had problems moving the Zend Framework from development to production. I changed my docroot to the public folder, updated my library path, but it's still not working out for me. The IndexController is working just fine, but my ServiceController is giving me an internal server error. ServiceController <?php class ServiceController extends Zend_Controller_Action { public function amfAction() { require_once APPLICATION_PATH . '/models/MyClass.php'; $srv = new Zend_Amf_Server(); $srv->setClass('Model_MyClass', 'MyClass'); echo $srv->handle(); exit; } }

    Read the article

  • access models and forms within modules

    - by sims
    Hi Stackers, What is the best way to access my models and forms from a controller of a module? Let's explain with "pictures": /application/module/storage/controllers/IndexController.php needs to call readAction in the class called storage_Model_Files in /application/module/storage/models/Files.php I've made this app's dir structure and these forms and models with zf.sh (Zend_Tool). I've read about all sorts of ways of manually including these files. I want to lazy load them much like everything is done automatically with the default module. I can't seem to find how in the docs. Does that make sense? I have: resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" in my application.ini file. So I can access my controllers fine. Thanks for your help!

    Read the article

  • Cannot redeclare class but there are no other classes with that name

    - by hsz
    Hello ! I am working right now with Zend Framework and I've created a Model_User_Row in app\models\User\Row.php. When I try to create an instance of that class in IndexController I get an error: Fatal error: Cannot redeclare class Model_User_Row in F:\Projekty\www\inz\app\models\User\Row.php on line 14 14th line is a close brace. <?php class Model_User_Row extends Zend_Db_Table_Row { /** * @return array */ public function toArray() { $res = parent::toArray(); unset($res['password']); return $res; } } // #14 In my project I have no other class called Model_User_Row. I am a bit confused - how to debug this case ?

    Read the article

  • Help with authorization and redirection decorator in python (pylons)

    - by ensnare
    I'm trying to write a simple decorator to check the authentication of a user, and to redirect to the login page if s/he is not authenticated: def authenticate(f): try: if user['authenticated'] is True: return f except: redirect_to(controller='login', action='index') class IndexController(BaseController): @authenticate def index(self): return render('/index.mako' ) But this approach doesn't work. When a user is authenticated, everything is fine. But when the user is not authenticated, redirect_to() doesn't work and I am given this error: HTTPFound: 302 Found Content-Type: text/html; charset=UTF-8 Content-Length: 0 location: /login Thank for your help!

    Read the article

  • Model class is not found in zend framework project (quickstart) ,please help

    - by Dumindu
    The things I did is zf create project demo1 in command prompt add the lines to application.ini appnamespace = "Application" resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts" add a layout with header and footer using partial() (They are perfectly worked) create Data.php in models directory and add this simple class <?php class Application_Model_Data{ }//Application for appnamespace then I tried to load this class(by creating instance)from index controller index action $data = new Application_Model_Data(); but when I test it even in this level it gives an error Fatal error: Class 'Application_Model_Data' not found in C:\Zend\...\IndexController.php Question Do I want to add a autoloader to load models in the application( I'm not used modules) if not what was I missed to add please help I'm stuck in the beginning,Thank you

    Read the article

  • Database, Jquery, Ajax and Zend Framework. How to use all togheter?

    - by rasouza
    I have a form rendered in the view which action is setted to the same page /index. <form action="" name="formRegistro" id="formRegistro"> and a JQuery function which is called when the form is submitted $('#formRegistro').submit(function() { // Retrevies data from the form data = $('#someInput').val() //Execute AJAX $.get( 'http://localhost/myproject/', { data }, function(data){ $('#divStatus').html(data); } ); //Prevent page loading return false; }); I'm using and if statement in the IndexController to change between normal view and post view if ($this->_request->isGet()) { and I'd like to output a message in the #divStatus but with I don't know how to do it

    Read the article

  • Add Zend_Navigation to the View with old legacy bootstrap

    - by Grant Collins
    Hi, I've been struggling with Zend_Navigation all weekend, and now I have another problem, which I believe has been the cause of a lot of my issues. I am trying to add Zend_Navigation to a legacy 1.7.6 Zend Framework application, i've updated the Zend Library to 1.9.0 and updated the bootstrap to allow this library update. The problem is that I don't know how, and the examples show the new bootstrap method of how to add the Navigation object to the view, I've tried this: //initialise the application layouts with the MVC helpers $layout = Zend_Layout::startMvc(array('layoutPath' => '../application/layouts')); $view = $layout->getView(); $configNav = new Zend_Config_Xml('../application/config/navigation.xml', 'navigation'); $navigation = new Zend_Navigation($configNav); $view->navigation($navigation); $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer(); $viewRenderer->setView($view); This seems to run through fine, but when I go to use the breadcrumb view helper in my layout, it errors with: Strict Standards: Creating default object from empty value in C:\www\moobia\development\website\application\modules\employers\controllers\IndexController.php on line 27 This is caused by the following code in the init() function of my controller. $uri = $this->_request->getPathInfo(); $activeNav = $this->view->navigation()->findByUri($uri); <- this is null when called $activeNav->active = true; I believe it's because the Zend_Navigation object is not in the view. I would look at migrating the bootstrap to the current method, but at present I am running out of time for a release. Thanks, Grant

    Read the article

  • Zend: How to authenticate using OpenId on local server.

    - by NAVEED
    I am using zend framework. Now I want to authenticate users with other already registered accounts using RPX. I am following the 3 steps as described at RPX site: 1- Get the Widget 2- Receive Tokens 3- Choose Providers I created a controller(person) and action(signin) to show widget and my own signin form. When following action (http://test.dev/#person/personsignin) is called then my own login form and widget is shown successfully. # is used in above URL for AJAX indication. public function personsigninAction() { $this->view->jsonEncoded = true; // Person Signin Form $PersonSigninForm = new Form_PersonSignin(); $this->view->PersonSigninForm = $PersonSigninForm; $this->view->PersonSigninForm->setAction( $this->view->url() ); $request = $this->getRequest(); if ( $request->isPost() ) { } } There are two problems while login using openid widget: When I am authenticated from outside(for example: Yahoo) then I am redirected to http://test.dev, therefor indexAction in called in indexController and home page is shown. I want to redirect to http://test.dev/#person/personsignin after authentication and want to set session in isPost() condition of personsigninAction() (described above). For now I consider indexAction to be called when outside authentication is done. Now I posted the code from http://gist.github.com/291396 in indexAction to follow step 3 mentioned above. But it is giving me following error: An error occured: Invalid parameter: apiKey Am I using the right way to use this. This is my very first attempt to this stuff. Can someone tell me the exact steps using my above actions? Thanks.

    Read the article

  • Deployed a Zend App on EC2 and its not working

    - by Gublooo
    Hey Guys, I'm confused about the problem and not sure if I can provide enough details. I have a php app built on Zend framework which I've successfully deployed on other hosting companies. I am now trying to move to Amazon EC2 I moved all my code and set my domain to point to the IP address. So far so good. Now when I access my home page say www.example.com - everything looks good - The home page opens up which means the IndexController is being called and the index method is properly executed which pulls data from the database and displays it in the index.phtml page. So this lets me to believe that everything is working fine. But every link I click on the home page whether its a simple contact us link - or any other action that I directly try to call even through the URL results in 404 Not Found The requested URL /user/add was not found on this server. Apache/2.2.9 (Fedora) Server at www.example.com Port 80 The interesting thing is the home page opens up fine when I call www.example.com but when I give the entire path which is www.example.com/index/index - I get the same above error. I have checked the logs and there are no errors. Has anyone encountered something similar or have any idea if I'm missing a simple step or something like rewrite rule maybe. Its running on LAMP Any ideas Thanks

    Read the article

  • Getting a "No default module defined for this application" exception while running controller unit t

    - by Doron
    I have an application with the default directory structure, for an application without custom modules (see structure figure at the end). I have written a ControllerTestCase.php file as instructed in many tutorials, and I've created the appropriate bootstrap file as well (once again, see figures at the end). I've written some model tests which run just fine, but when I started writing the index controller test file, with only one test in it, with only one line in it ("$this-dispatch('/');"), I'm getting the following exception when running phpunit (but navigating with the browser to the same location - all is good and working): 1) IndexControllerTest::test_indexAction_noParams Zend_Controller_Exception: No default module defined for this application Why is this ? What have I done wrong ? Appendixes: Directory structure: -proj/ -application/ -controllers/ -IndexController.php -ErrorController.php -config/ -layouts/ -models/ -views/ -helpers/ -scripts/ -error/ -error.phtml -index/ -index.phtml -Bootstrap.php -library/ -tests/ -application/ -controllers/ -IndexControllerTest.php -models/ -bootstrap.php -ControllerTestCase.php -library/ -phpunit.xml -public/ -index.php (Basically I have some more files in the models directory, but that's not relevant to this question.) application.ini file: [production] phpSettings.display_startup_errors = 0 phpSettings.display_errors = 0 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" appnamespace = "My" resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" resources.frontController.params.displayExceptions = 0 resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/" resources.view[] = phpSettings.date.timezone = "America/Los_Angeles" [staging : production] [testing : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 resources.frontController.params.displayExceptions = 1 tests/application/bootstrap.php file <?php error_reporting(E_ALL); // Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application')); // Define application environment defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'testing')); // Ensure library/ is on include_path set_include_path(implode(PATH_SEPARATOR, array( realpath(APPLICATION_PATH . '/../library'), // this project' library get_include_path(), ))); /** Zend_Application */ require_once 'Zend/Application.php'; require_once 'ControllerTestCase.php';

    Read the article

  • How to start AJAX in Zend?

    - by Awan
    I am working on some projects as a developer(PHP,MySQL) in which AJAX and jQuery is already implemented. But now I want to learn implementation of AJAX and jQuery stuff. Can anyone tell me the exact steps with explanation? I have created a project in Zend. There is only one controller(IndexController) and two actions(a and b) in my project now. Now I want to use ajax in my project. But I don't know how to start. I read some tutorial but unable to completely understand. I have index.phtml like this: <a href='index/a'>Load info A</a> <br/> <a href='index/b'>Load info B</a> <br /> <div id=one>load first here<div> <div id=two>load second here</div> Here index is controller in links. a and b are actions. now I have four files like this: a1.phtml I am a1 a2.phtml I am a2 b1.phtml I am b1 b2.phtml I am b2 I think you have got my point. When user clicks first link (Load info A) then a1.phtml should be loaded into div one and a2.phtml should be loaded into div two When user clicks second link (Load info B) then b1.phtml should be loaded into div one and b2.phtml should be loaded into div two And someone tell me the purpose of JSON in this process and how to use this also? Thanks

    Read the article

  • How to start with AJAX/JSON in Zend?

    - by Awan
    I am working on some projects as a developer(PHP,MySQL) in which AJAX and jQuery is already implemented. But now I want to learn implementation of AJAX and jQuery stuff. Can anyone tell me the exact steps with explanation? I have created a project in Zend. There is only one controller(IndexController) and two actions(a and b) in my project now. Now I want to use ajax in my project. But I don't know how to start. I read some tutorial but unable to completely understand. I have index.phtml like this: <a href='index/a'>Load info A</a> <br/> <a href='index/b'>Load info B</a> <br /> <div id=one>load first here<div> <div id=two>load second here</div> Here index is controller in links. a and b are actions. now I have four files like this: a1.phtml I am a1 a2.phtml I am a2 b1.phtml I am b1 b2.phtml I am b2 I think you have got my point. When user clicks first link (Load info A) then a1.phtml should be loaded into div one and a2.phtml should be loaded into div two When user clicks second link (Load info B) then b1.phtml should be loaded into div one and b2.phtml should be loaded into div two And someone tell me the purpose of JSON in this process and how to use this also? Thanks

    Read the article

  • Zend Partial + Zend Action Helper causes an additional request to bootstrap?

    - by AndreLiem
    I've been profiling some zend framework code with webgrind to see where some bottle necks are and I'm noticing some very odd behavior. Using the zend partial for example, if I pass a variable value that comes from a zend action helper, it results in two requests being made. in sample.phtml echo $this->partial('partial/embed.phtml', array('url' => $this->url)); in indexcontroller.php $this->view->url = $this->_helper->Embed()->url; But if I don't pass the value from the helper to the partial, but still run the helper, it only makes one request in webgrind. e.g. $this->view->url = 'test'; $this->_helper->Embed()->url; Does anybody know why this could be happening? Am I potentially interpreting web grind incorrectly, or is it really calling the bootstrap twice when the an action helper value is tied to a partial? I'm starting to realize how inefficient some components of Zend are. Thanks

    Read the article

  • Two Objects created with the same Address in Flex

    - by James
    Hi, I have an issue in flex which is causing a bit of a headache! I am adding objects to an ArrayCollection but in doing so, another ArrayCollection is also picking up these changes even though there is no binding occurring. I can see from the debug that the two ACs have the same address but for the life of me can't figure out why. I have two Array Collections: model.index.rows //The main array collection model.index.holdRows //The array collection that imitates the above This phantom data binding occurs only for the first iteration in the loop and for all others it will just write it the once. The reason this is proving troublesome is that it creates duplicate entries in my datagrid. public override function handleMessage(message:IMessage):void { super.handleMessage(message); if (message is IndexResponse) { var response:IndexResponse = message as IndexResponse; model.index.rows.removeAll(); model.index.indexIsEmpty = response.nullIndex; if (model.index.indexIsEmpty !== true) { //Update the index model from the response. Note: each property of the row object will be shown in the UI as a column in the grid response.index.forEach(function(entry:EntryData, i:int, a:Array):void { var row:Object = { fileID: entry.fileID, dadName: entry.dadName }; entry.tags.forEach(function(tag:Tag, i:int, a:Array):void { row[tag.name] = tag.value; }); model.index.rows.addItem(row); }); if(model.index.indexForNetworkView == true){ model.index.holdRows.source = model.index.holdRows.source.concat(model.index.rows.source); model.index.indexCounter++; model.index.indexForNetworkView = false; controller.indexController.showNetwork(model.index.indexCounter); } model.index.rows.refresh(); controller.networkController.show(); } } Has anyone else who has encountered something simillar propose a solution?

    Read the article

  • [Zend Framework] Forms and success output

    - by rasouza
    Well, It's a beginer's question but I really don't know what is the best way. I have a basic CRUD (Create, Retrieve, Update and Delete) in my project and I'd like to output some message if succeded or not in a div inside the same page. So, basically, I have a form which action is setted to the same page and I have a div #statusDiv below this same form which I'd like to output something like Register included with success. What is the best way for doing this? Set a flag in the controller $this->view->flagStatus = 'message' then call it in the view? Just to make it more clear. It's my code: //IndexController.php indexAction() ... //Check if there's submitted data if ($this->getRequest()->isPost()) { ... $registries->insert($data); $this->view->flagStatus = 'message'; $this->_redirect('/'); } Then my view: .... <?php if ($this->flagStatus) { ?> <div id="divStatus" class="success span-5" style="display: none;"> <?php echo $this->flagStatus; ?> </div> <?php } ?> ....

    Read the article

  • How do I call the methods in a model via controller? Zend Framework

    - by Joel
    Hi guys, I've been searching for tutorials to better understand this, but I'm having no luck. Please forgive the lengthy explination, but I want make sure I explain myself well. First, I'm quite new to the MVC structure, though I have been doing tutorials and learning as best I can. I have been moving over a live site into the Zend Framework model. So far, I have all the views within views/scripts/index/example.phtml. So therefore I'm using one IndexController and I have the code in each Action method for each page: IE public function exampleAction() Because I didn't know how to interact with a model, I put all the methods at the bottom of the controller (a fat controller). So basically, I had a working site by using a View and Controller and no model. ... Now I'm trying to learn how to incorporate the Model. So I created a View at: view/scripts/calendar/index.phtml I created a new Controller at: controller/CalendarControllers.php and a new model at: model/Calendar.php The problem is I think I'm not correctly communication with the model (I'm still new to OOP). Can you look over my controller and model and tell me if you see a problem. I'm needing to return an array from runCalendarScript(), but I'm not sure if I can return an array into the object like I'm trying to? I don't really understand how to "run" the runCalendarScript() from the controller? Thanks for any help! I'm stripping out most of the guts of the methods for the sake of brevity: controller: <?php class CalendarController extends Zend_Controller_Action { public function indexAction() { $finishedFeedArray = new Application_Model_Calendar(); $this->view->googleArray = $finishedFeedArray; } } model: <?php class Application_Model_Calendar { public function _runCalendarScript(){ $gcal = $this->_validateCalendarConnection(); $uncleanedFeedArray = $this->_getCalendarFeed($gcal); $finishedFeedArray = $this->_cleanFeed($uncleanedFeedArray); return $finishedFeedArray; } //Validate Google Calendar connection public function _validateCalendarConnection() { ... return $gcal; } //extracts googles calendar object into the $feed object public function _getCalendarFeed($gcal) { ... return $feed; } //cleans the feed to just text, etc protected function _cleanFeed($uncleanedFeedArray) { $contentText = $this->_cleanupText($event); $eventData = $this->_filterEventDetails($contentText); return $cleanedArray; } //Cleans up all formatting of text from Calendar feed public function _cleanupText($event) { ... return $contentText; } //filterEventDetails protected function _filterEventDetails($contentText) { ... return $data; } }

    Read the article

< Previous Page | 1 2