Search Results

Search found 4341 results on 174 pages for 'zend navigation'.

Page 31/174 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • MVC - thin controller idea - Codeigniter/Zend

    - by user505988
    Hi, Could some one possibly clarify this for me. In the MVC paradigm, the idea is to keep the controller as thin as possible, it is also true that the model is the bit that communicates with data sources such as the database, XML-RPC etc and this is where the business logic should go. Is the POST and GET data a 'data source' and should that kind of data be handled by the model or should it be by the controller. I would normally call a method in the model and pass it the post data, the data would be quality checked by the controller and the model method would simply do the insertion or whatever. Should it be though that controller just calls the model method if a post has occured and it is responsible for sanity check, data checks etc.

    Read the article

  • zend form check record no exists in database

    - by Yafa Su
    I have a form that check if email exists in the database within 2 tables. I'm using Zend_Validate_Db_NoRecordExists for both validate, but it only check the second one. Any idea why it's not working? class Application_Form_ReferUser extends Zend_Form { public $email, $freeDownload, $buyNow; public function init() { $this->setName('referUser'); $EmailExists = new Zend_Validate_Db_NoRecordExists( array( 'table' => 'referrals', 'field' => 'email' ) ); $EmailExists2 = new Zend_Validate_Db_NoRecordExists( array( 'table' => 'users', 'field' => 'email' ) ); $EmailExists->setMessage('This e-mail is already taken'); $EmailExists2->setMessage('This e-mail is already taken'); $this->email = $this->createElement('text', 'email') ->setLabel('Email') ->addValidator($EmailExists) ->addValidator($EmailExists2) ->addValidator('EmailAddress') ->setRequired(true); $this->freeDownload = $this->createElement('button', 'btn_free_download') ->setLabel('Free Download') ->setAttrib('type', 'submit'); $this->buyNow = $this->createElement('button', 'btn_buy_now') ->setLabel('Buy Now') ->setAttrib('type', 'submit'); $this->addElements(array($this->email, $this->freeDownload, $this->buyNow)); $elementDecorators = array( 'ViewHelper' ); $this->setElementDecorators($elementDecorators); } }

    Read the article

  • Unable to send an associative array in JSON format in Zend to client

    - by Anorflame
    Hi, In one of my actions in a controller, I'm using the json view helper to send back a response to an ajax request. On the client side I alert the data that is passed to the success callback function. It works fine as long as the response is a number or an array with default keys. Once I try to send an associative array, it alerts with [object Object]. Server code: $childArray = array('key'=>'value'); $this->_helper->json($childArray); javascript: function displayChildren(data){ alert(data); } ... $.ajax({ url: "/po/add", dataType: "json", data: {format: "json"}, success: displayChildren }); I have no idea what am I doing wrong here, so any help would be appreciated...

    Read the article

  • Generating a zend form with dynamic data?

    - by meder
    I need to access my session and based on the session property I need to grab stuff from the database to use as options in my dropdown. $_SESSION is: [sess_name] => Array( [properties] => Array( 1=> Hotel A, 2=> Hotel B ), [selected] => 1 ) I need to grab Hotel A from selected, and then access all accounts under Hotel A from the database: id title hotel_id ------------------------------ 1 Hotel A Twitter Account 1 2 Hotel B Facebook Account 2 3 Hotel A Facebook Account 1 I need ids 1 and 3 because my hotel_id is 1 in the context of: $this->addElement( 'select', 'account', array( 'multioptions' => $NEED_IT_HERE )); Here's my query / session grabbing code: $cs = new Zend_Session_Namespace( SESS_NAME ); $model = new Model_DbTable_Social; $s = " SELECT social_accounts.* FROM social_accounts LEFT JOIN social_media_outlets ON social_media_outlets.id = social_accounts.property WHERE social_accounts.property=".(int)$cs->selectedclient; I have this code in my form page, but I need to move it into my model now.

    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

  • Question creating PDF document in Zend Framework

    - by deaddancer
    I need to take a ZF rendered view and create a PDF that should look pretty much exactly the same, and email it. The major issue I have right now is getting the HTML created by the view into a string that I can then process with the Zend_PDF::parse method. The view I need to turn into a PDF is the result of a posted form. I've tried grabbing the contents of ob_get_contents into a string after a successful post, but for some reason its not in there. Should I press on with this angle? Any help would be greatly appreciated!

    Read the article

  • Pass a variable from postDispatch() to view instance in Zend Framework

    - by takeshin
    I have a controller plugin with postDispatch() hook, and there I have a $variable. How to pass this variable to the view instance? I tried Zend_Layout::getMvcInstance()->getView(), but this returns new view instance (not the application resource). The same with $bootstrap->getResource('view'). I don't want to pass it as a request param. Now, as a workaround I do it using Zend_Registry. But, is it the best way?

    Read the article

  • Make a router like zend

    - by Vahan
    I have a url http://*.com/branch/module/view/id/1/cat/2/etc/3. It becomes. array ( 'module'=>'branch', 'controller'=>'module', 'action'=>'view' ); next I need to get the params. Ihave this array. /*function getNextSegments($n,$segments) { return array_slice ( $q = $this->segments, $n + 1 ); } $params = getNextSegments(3); */ array ( 0 => 'id', 1 => '1', 2 => 'cat', 3 => '2', 4 => 'etc', 5 => '3' );//params And i wanna convert it to this one: array ( 'id'=1, 'cat'=2, 'etc'=3, ); How i can do this using php function. I know I can do using for or foreach, but I think php has such function , but i cant find it :(. Thank you. class A { protected function combine($params) { $count = count ( $params ); $returnArray = array (); for($i = 0; $i < $count; $i += 2) { $g = $i % 2; if ($g == 0 or $g > 0) { if (isset ( $params [$i] ) and isset ( $params [$i + 1] )) $returnArray [$params [$i]] = $params [$i + 1]; } } return $returnArray; } } This works normaly. If anybody has better login for this please help. Thank you again.

    Read the article

  • Zend Framework How can I print a logged in user name from a Zend_Session_Namespace

    - by IrishStudent76
    Hi all I have created the following login controller for my site and it works fine in relation to logging users in a logging them out. The thing I want to do is echo the logged in users name into the FlashMessenger for the success page how ever as my code stands I only get the following message when redirected to the success page, "you have been successfully logged in as Array". Can I also ask the following does the line $session-user =$adaptergetResultArray('Password'); create an array of user information less the password value from the database. Many Thanks in advance, IrishStudent76 <?php class LoginController extends Zend_Controller_Action { public function init(){ $this->view->doctype('XHTML1_STRICT'); } // login action public function loginAction() { $form = new PetManager_Form_Login; $this->view->form = $form; /* check for valid input from the form and authenticate using adapter Add user record to session and redirect to the original request URL if present */ if ($this->getRequest()->isPost()) { if ($form->isValid($this->getRequest()->getPost())) { $values = $form->getValues(); $adapter = new PetManager_Auth_Adapter_Doctrine( $values['username'], $values['password'] ); $auth = Zend_Auth::getInstance(); $result = $auth->authenticate($adapter); if ($result->isValid()) { $session = new Zend_Session_Namespace('petmanager.auth'); $session->user = $adapter->getResultArray('Password'); if (isset($session->requestURL)) { $url = $session->requestURL; unset($session->requestURL); $this->_redirect($url); } else { $this->_helper->getHelper('FlashMessenger') ->addMessage('You have been successfully logged in as '.$session- >user); $this->_redirect('/login/success'); } } else { $this->view->message = 'You could not be logged in. Please try again.'; } } } } public function successAction() { if ($this->_helper->getHelper('FlashMessenger')->getMessages()) { $this->view->messages = $this->_helper ->getHelper('FlashMessenger') ->getMessages(); } else { $this->_redirect('/login'); } } public function logoutAction() { Zend_Auth::getInstance()->clearIdentity(); Zend_Session::destroy(); $this->_redirect('/'); } }

    Read the article

  • Getting an Ajax response from Zend Framework Controller

    - by JavaLava
    I'm doing an Ajax request on one of my views to a Controller but I am unable to send back a response to the Ajax method. In the snippet below, I am trying to send the word 'hellopanda' back but in the alert message, I'll get data as an object. View : $.ajax({ type: "POST", url: "localhost/some-activity", data: dataString, success: function(data) { alert( "Data is: " + data); //do something with data }, error: function(data){ alert( "Data is: " + data); //do something with data }, onComplete: function(){ } }); Controller: public function someActivityAction(){ //do stuff echo "hellopanda"; } I'm pretty sure the echo is the problem. Any insights on to how to do a proper response to the view would be greatly appreciated.

    Read the article

  • Zend Framework headLink() helper and HTML5

    - by Richard Knop
    I have set doctype to HTML 5 like this: $view->doctype('HTML5'); Then I have added a stylesheet like this: $view->headLink()->appendStylesheet($view->baseUrl().'/css/reset.css'); It produces link tag like this: <link href="/css/reset.css" media="screen" rel="stylesheet" type="text/css" > But for HTML 5 this would be correct, no? <link rel="stylesheet" href="/css/reset.css"> One more question. How to produce meta tag like this with headMeta() helper? <meta charset="utf-8">

    Read the article

  • Silverlight Recruiting Application Part 4 - Navigation and Modules

    After our brief intermission (and the craziness of Q1 2010 release week), we're back on track here and today we get to dive into how we are going to navigate through our applications as well as how to set up our modules. That way, as I start adding the functionality- adding Jobs and Applicants, Interview Scheduling, and finally a handy Dashboard- you'll see how everything is communicating back and forth. This is all leading up to an eventual webinar, in which I'll dive into this process and give a honest look at the current story for MVVM vs. Code-Behind applications. (For a look at the future with SL4 and a little thing called MEF, check out what Ross is doing over at his blog!) Preamble... Before getting into really talking about this app, I've done a little bit of work ahead of time to create a ton of files that I'll need. Since the webinar is going to cover the Dashboard, it's not here, but otherwise this is a look at what the project layout looks like (and remember, this is both projects since they share the .Web): So as you can see, from an architecture perspective, the code-behind app is much smaller and more streamlined- aka a better fit for the one man shop that is me. Each module in the MVVM app has the same setup, which is the Module class and corresponding Views and ViewModels. Since the code-behind app doesn't need a go-between project like Infrastructure, each MVVM module is instead replaced by a single Silverlight UserControl which will contain all the logic for each respective bit of functionality. My Very First Module Navigation is going to be key to my application, so I figured the first thing I would setup is my MenuModule. First step here is creating a Silverlight Class Library named MenuModule, creatingthe View and ViewModel folders, and adding the MenuModule.cs class to handle module loading. The most important thing here is that my MenuModule inherits from IModule, which runs an Initialize on each module as it is created that, in my case, adds the views to the correct regions. Here's the MenuModule.cs code: public class MenuModule : IModule { private readonly IRegionManager regionManager; private readonly IUnityContainer container; public MenuModule(IUnityContainer container, IRegionManager regionmanager) { this.container = container; this.regionManager = regionmanager; } public void Initialize() { var addMenuView = container.Resolve<MenuView>(); regionManager.Regions["MenuRegion"].Add(addMenuView); } } Pretty straightforward here... We inject a container and region manager from Prism/Unity, then upon initialization we grab the view (out of our Views folder) and add it to the region it needs to live in. Simple, right? When the MenuView is created, the only thing in the code-behind is a reference to the set the MenuViewModel as the DataContext. I'd like to achieve MVVM nirvana and have zero code-behind by placing the viewmodel in the XAML, but for the reasons listed further below I can't. Navigation - MVVM Since navigation isn't the biggest concern in putting this whole thing together, I'm using the Button control to handle different options for loading up views/modules. There is another reason for this- out of the box, Prism has command support for buttons, which is one less custom command I had to work up for the functionality I would need. This comes from the Microsoft.Practices.Composite.Presentation assembly and looks as follows when put in code: <Button x:Name="xGoToJobs" Style="{StaticResource menuStyle}" Content="Jobs" cal:Click.Command="{Binding GoModule}" cal:Click.CommandParameter="JobPostingsView" /> For quick reference, 'menuStyle' is just taking care of margins and spacing, otherwise it looks, feels, and functions like everyone's favorite Button. What MVVM's this up is that the Click.Command is tying to a DelegateCommand (also coming fromPrism) on the backend. This setup allows you to tie user interaction to a command you setup in your viewmodel, which replaces the standard event-based setup you'd see in the code-behind app. Due to databinding magic, it all just works. When we get looking at the DelegateCommand in code, it ends up like this: public class MenuViewModel : ViewModelBase { private readonly IRegionManager regionManager; public DelegateCommand<object> GoModule { get; set; } public MenuViewModel(IRegionManager regionmanager) { this.regionManager = regionmanager; this.GoModule = new DelegateCommand<object>(this.goToView); } public void goToView(object obj) { MakeMeActive(this.regionManager, "MainRegion", obj.ToString()); } } Another for reference, ViewModelBase takes care of iNotifyPropertyChanged and MakeMeActive, which switches views in the MainRegion based on the parameters. So our public DelegateCommand GoModule ties to our command on the view, that in turn calls goToView, and the parameter on the button is the name of the view (which we pass with obj.ToString()) to activate. And how do the views get the names I can pass as a string? When I called regionManager.Regions[regionname].Add(view), there is an overload that allows for .Add(view, "viewname"), with viewname being what I use to activate views. You'll see that in action next installment, just wanted to clarify how that works. With this setup, I create two more buttons in my MenuView and the MenuModule is good to go. Last step is to make sure my MenuModule loads in my Bootstrapper: protected override IModuleCatalog GetModuleCatalog() { ModuleCatalog catalog = new ModuleCatalog(); // add modules here catalog.AddModule(typeof(MenuModule.MenuModule)); return catalog; } Clean, simple, MVVM-delicious. Navigation - Code-Behind Keeping with the history of significantly shorter code-behind sections of this series, Navigation will be no different. I promise. As I explained in a prior post, due to the one-project setup I don't have to worry about the same concerns so my menu is part of MainPage.xaml. So I can cheese-it a bit, though, since I've already got three buttons all set I'm just copying that code and adding three click-events instead of the command/commandparameter setup: <!-- Menu Region --> <StackPanel Grid.Row="1" Orientation="Vertical"> <Button x:Name="xJobsButton" Content="Jobs" Style="{StaticResource menuStyleCB}" Click="xJobsButton_Click" /> <Button x:Name="xApplicantsButton" Content="Applicants" Style="{StaticResource menuStyleCB}" Click="xApplicantsButton_Click" /> <Button x:Name="xSchedulingModule" Content="Scheduling" Style="{StaticResource menuStyleCB}" Click="xSchedulingModule_Click" /> </StackPanel> Simple, easy to use events, and no extra assemblies required! Since the code for loading each view will be similar, we'll focus on JobsView for now.The code-behind with this setup looks something like... private JobsView _jobsView; public MainPage() { InitializeComponent(); } private void xJobsButton_Click(object sender, RoutedEventArgs e) { if (MainRegion.Content.GetType() != typeof(JobsView)) { if (_jobsView == null) _jobsView = new JobsView(); MainRegion.Content = _jobsView; } } What am I doing here? First, for each 'view' I create a private reference which MainPage will hold on to. This allows for a little bit of state-maintenance when switching views. When a button is clicked, first we make sure the 'view' typeisn't active (why load it again if it is already at center stage?), then we check if the view has been created and create if necessary, then load it up. Three steps to switching views and is easy as pie. Part 4 Results The end result of all this is that I now have a menu module (MVVM) and a menu section (code-behind) that load their respective views. Since I'm using the same exact XAML (except with commands/events depending on the project), the end result for both is again exactly the same and I'll show a slightly larger image to show it off: Next time, we add the Jobs Module and wire up RadGridView and a separate edit page to handle adding and editing new jobs. That's when things get fun. And somewhere down the line, I'll make the menu look slicker. :) Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Proper error handling in a custom Zend_Autoloader?

    - by Pekka
    I'm building a custom autoloader based on Zend Framework's autoloading (related question here). The basic approach, taken from that question, is class My_Autoloader implements Zend_Loader_Autoloader_Interface { public function autoload($class) { // add your logic to find the required classes in here } } and then binding the new autoloader class to a class prefix. Now what I'm unsure about is how to handle errors inside the autoload method (for example, "class file not found") in a proper, ZF compliant way. I'm new to the framework, its conventions and style. Do I quietly return false and let the class creation process crash? Do I output an error or log message somehow (which would be nice to pinpoint the problem) and return false? If so, what is the Zend way of doing that? Do I trigger an error? Do I throw an exception? If so, what kind?

    Read the article

  • iPhone:How to make navigation top bar style to same like "Black Navigation Bar" programmatically?

    - by Getsy
    I have a Navigation project which has only a TableView. By default, i could see the navigation bar there when running the application. I want to change the navigation bar style to same like if we see in I.B there is one called "Top Bar" which has "Black Navigation Bar" style (Which shows Black navigation top bar but some kind of Gray shade will be there). I want the same in my navigation bar now, not any other color or style. How do i fix it? Note: 1. I used "self.navigationController.navigationBar.barStyle = UIBarStyleBlack;" , but it shows the navigation bar in utter black color. I don't want that, i want some kind of Gray shade in black, similar to "Top Bar" which has "Black Navigation Bar". I tried some tint color addition to the above, like "self.navigationController.navigationBar.tintColor = [UIColor grayColor];" but i observe the same utter black shows in navigation bar. I tried "navigationBar.barStyle = UIBarStyleBlackTranslucent;" but it doesn't fit and show with status bar properly. Instead it overlaps(hidden) half black with status bar and half black shows outside. Could someone teach me? Thank you.

    Read the article

  • Word 2010 Navigation Pane and more

    I have been using Office 2010 since Beta1 and have not looked back since. I am currently on an internal RC, but will upgrade tomorrow to the RTM version. There are a plethora of new productivity features and for Word 2010 the one that overshadows everything else, IMO, is the Navigation Pane. I could spend time describing it here, but I'll never be able to cover it more thoroughly than what the product team has on their blog post. You enable it via the "Navigation Pane" checkbox in...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Disabling Navigation Flicks in WPF

    - by Brian Genisio's House Of Bilz
    I am currently working on a multi-touch application using WPF.  One thing that has been irritating me with this development is an automatic navigation forward/back command that is bound to forward and backwards flicks.  Many of my touch-based interactions were being thwarted by gestures picked up by WPF as navigation.  I just wanted to disable this behavior. My programmatic back/forward calls are not affected by this change, which is nice.  Here is how I did it:  In my main window, I added the following command bindings:<NavigationWindow.CommandBindings> <CommandBinding Command="NavigationCommands.BrowseBack" Executed="DoNothing" /> <CommandBinding Command="NavigationCommands.BrowseForward" Executed="DoNothing" /> </NavigationWindow.CommandBindings> Then, the DoNothing method in the code-behind does nothing:private void DoNothing(object sender, ExecutedRoutedEventArgs e) { } There may be a better way to do this, but I haven’t found one.

    Read the article

  • SharePoint Navigation - Setting the Audience Property of an SPNavigationNode

    - by jhallal
    In this tip/trick i will demonstrate a way of setting by code the target audience of an SP navigation node.You might say setting this property in SharePoint UI is quite simple, but if you want to set it by code you will not find any straight forward property or method out of the box in SharePoint Object Model that does the job. The SPNavigationNode class has a property called “Properties”, which allows us to add custom properties to the node. One of the Property is “Audience”, which is used for setting the target audience on the navigation node. using (SPSite site = new SPSite("URL of your SharePoint Site")) {                using (SPWeb web = site.OpenWeb())         {             SPNavigationNode navNode = web.Navigation.GlobalNodes[0];              if (navNode.Properties.Contains("Audience"))             {                 navNode.Properties["Audience"] = "Users or Groups";             }             else             {                 navNode.Properties.Add("Audience", "Users or Groups");             }             navNode.Update();         } }

    Read the article

  • PeopleSoft New Design Solves Navigation Problem

    - by Applications User Experience
    Anna Budovsky, User Experience Principal Designer, Applications User Experience In PeopleSoft we strive to improve User Experience on all levels. Simplifying navigation and streamlining access to the most important pages is always an important goal. No one likes to waste time waiting for pages to load and watching a spinning glass going on and on. Those performance-affecting server trips, page-load waits and just-too-many clicks were complained about for a long time. Something had to be done. A few new designs came in PeopleSoft 9.2 helping users to access their everyday work areas easier and faster. For example, Dashboard and Work Center aggregate most accessed information sections on a single page; Related Information allows users to complete transaction-related-research without interrupting a transaction and Secure Search gets users to a specific page directly. Today we’ll talk about the Actions menu. Most PeopleSoft pages are shared between individual products and product lines. It means changing the content on a single page involves Oracle development and quality assurance time for making and testing the changes. In order to streamline the navigation and cut down on accessing PeopleSoft pages one-page-at-a-time, we introduced a new menu design. The new menu allows accessing shared pages without the Oracle development team making any local changes, and it works as an additional one-click-path to specific high-traffic actionable pages. Let’s look at how many steps it took to Change Salary for an employee in HCM 9.1 before: Figure 1. BEFORE: The 6 steps a user would take to Change Salary in PeopleSoft HCM 9.1 In PeopleSoft 9.1 it took 5 steps + page loading time + additional verification time for making sure a correct employee is selected from the table. In PeopleSoft 9.2 it only takes 2 steps. To complete Ad Hoc Change Salary action, the user can start from the HCM Manager's Dashboard, click the Action menu within a table, choose a menu option, and access a correct employee’s details page to take an action. Figure 2. AFTER: The 2 steps a user would take to Change Salary in PeopleSoft HCM 9.2 The new menu is placed on a row level which ensures the user accesses the correct employee’s details page. The Actions menu separates menu options into hierarchical sections which help to scan and access the correct option quickly. The new menu’s small size and its structure enabled users to access high-traffic pages from any page and from any part of the page. No more spinning hourglass, no more multiple pages upload. The flexible design fits anywhere on a page and provides a fast and reliable path to the correct destination within the product. Now users can: Access any target page no matter how far it is buried from the starting point; Reduce navigation and page-load time; Improve productivity and reduce errors. The new menu design is available and widely used in all PeopleSoft 9.2 product lines.

    Read the article

  • webmaster tools 500 crawl error for asp faceted navigation that does not exist

    - by user19007
    i am getting 2,500 type 500 url errors in google webmaster tools. These pages are faceted navigation results that can not be reached by a site visitor. These pages do not exist. We are using faceted navigation with the Volusion platform (asp.net, I think). I have specified url parameters in webmaster tools so that google will not try to index anything faceted. This does not stop the errors from generating. I am concerned about how this might effect seo (bleeding page rank). I can provide additional information if needed. I am not sure how to solve this. I have started down the path of creating 301's, but having some difficulty there as well.

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >